Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Not showing any figure #47

Closed
pluiez opened this issue Apr 9, 2019 · 4 comments
Closed

Not showing any figure #47

pluiez opened this issue Apr 9, 2019 · 4 comments

Comments

@pluiez
Copy link

pluiez commented Apr 9, 2019

Hi I'm new to plotly_express and also plotly, please correct me if I missed anything. I followed the steps described walkthrough.ipynb, and run the following code snippet in a single python file but nothing happened, no figure and nothing generated.

import plotly_express as px
gapminder = px.data.gapminder()
gapminder2007 = gapminder.query("year == 2007")

px.scatter(gapminder2007, x="gdpPercap", y="lifeExp")

Do I need to plot the figure by using plot(fig) like in matplotlib?
Thanks!

@nicolaskruchten
Copy link
Member

Are you in JupyterLab by chance? There’s an extra installation step in the ReadMe for jlab... if not, can you tell me about your environment please?

@pluiez
Copy link
Author

pluiez commented Apr 10, 2019

Are you in JupyterLab by chance? There’s an extra installation step in the ReadMe for jlab... if not, can you tell me about your environment please?

Hi, thank you for your reply. I'm using Ubuntu 16.04 and python 3.7.3. I put the above code in a demo.py file and run it from the terminal, I'm sure I'm not in Jupyter notebook or ipython. The installed packages are as follows:

Package          Version 
---------------- --------
attrs            19.1.0  
certifi          2019.3.9
chardet          3.0.4   
decorator        4.4.0   
idna             2.8     
ipython-genutils 0.2.0   
jsonschema       3.0.1   
jupyter-core     4.4.0   
nbformat         4.4.0   
numpy            1.16.2  
pandas           0.24.2  
patsy            0.5.1   
pip              19.0.3  
plotly           3.7.1   
plotly-express   0.1.3   
pyrsistent       0.14.11 
python-dateutil  2.8.0   
pytz             2018.9  
requests         2.21.0  
retrying         1.3.3   
scipy            1.2.1   
setuptools       40.8.0  
six              1.12.0  
statsmodels      0.9.0   
traitlets        4.3.2   
urllib3          1.24.1  
wheel            0.33.1  

Please tell me if you need more information.

@nicolaskruchten
Copy link
Member

Ah so the issue is that Plotly Express only renders in a browser so you can't use it from the terminal alone. You need to either use Jupyter or save the resulting objects to HTML files and open those files in a browser.

@pluiez
Copy link
Author

pluiez commented Apr 13, 2019

Ah so the issue is that Plotly Express only renders in a browser so you can't use it from the terminal alone. You need to either use Jupyter or save the resulting objects to HTML files and open those files in a browser.

Oh I see. Thank you for your help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants