How to load a chart made in Jupyter into Chart Studio to then publish on a blog

Hi,

I am unable to import my charts into Chart Studio, because I don’t understand how to import a chart from a Python script (by copying and pasting then) or via the HTML file directly. How can I do that?

I can upload the Jupyter Notebook, but the file does not render properly (some text is missing).

Are there ways to import HTML files directly, or instead use the python code directly instead of doing it via a notebook?

Thanks in advance!

Are you using the chart_studio python package?

No, I’m using the Chart Studio website/interface. What’s the added value of the Python package?

Thanks for your answer by the way! : )

@MitchBuchanon you can push your graphs directly from Jupyter to your Chart Studio account

import chart_studio
import chart_studio.plotly as py
import plotly.express as px

name = 'your username'
k = 'your api key'
chart_studio.tools.set_credentials_file(username=name, api_key=k)

df = px.data.gapminder().query("country=='Canada'")
fig = px.line(df, x='year', y='lifeExp', title='Life expectancy in Canada')

py.plot(fig, filename='basic-line', auto_open=True)
1 Like

It works, thank you so much! : )