go.Figure() does not render in JupyterLab, only go.FigureWidget()
See original GitHub issuego.Figure()
does not render in JupyterLab, only go.FigureWidget()
.
Chrome Console Error: Uncaught ReferenceError: require is not defined
Example:
import plotly
import plotly.io as pio
import plotly.graph_objects as go
figwidget = go.FigureWidget(data=go.Bar(y=[1, 2, 3]))
fig = go.Figure(data=go.Bar(y=[3, 2, 1]))
display(pio.renderers)
display(figwidget)
display(fig)
Jupyter & Plotly specifics:
%load_ext watermark
%watermark -d -iv -v -m -u -n -t -z
!jupyter labextension list plotly
plotly 4.4.1
last updated: 2020-01-12 22:40:00 EST
CPython 3.7.6
IPython 7.11.1
compiler : Clang 4.0.1 (tags/RELEASE_401/final)
system : Darwin
release : 19.2.0
machine : x86_64
processor : i386
CPU cores : 4
interpreter: 64bit
JupyterLab v1.2.4
Known labextensions:
app dir: ~/anaconda3/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v1.1.0 enabled OK
jupyterlab-plotly v1.4.0 enabled OK
plotlywidget v1.4.0 enabled OK
qgrid v1.1.1 enabled OK
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
FigureWidget doesn't print graph - Plotly Community Forum
The following code doesn't output anything: import plotly.graph_objects as go f = go.FigureWidget() f. while this code 'w/ the .show()' ...
Read more >Plotly chart not showing in Jupyter notebook - Stack Overflow
There are two extensions: jupyterlab-plotly for rendering figures with fig.show() and plotlywidget for the FigureWidget .
Read more >Getting Started with Plotly-Python | by hemanshi - Medium
import plotly.graph_objects as go fig = go.Figure(data=go.Bar(y=[2, 3, 1])) fig.show(). or using FigureWidget objects.
Read more >Plotly i - Tutorialspoint
Finally, there is a Figure object created by go.Figure() function. It is a dictionary-like object that contains both the data object and the...
Read more >Unable to display plotly figures output - JupyterLab
When rendering plotly figures, I get an empty white frame. Example code: import plotly.express as px df = px.data.iris() fig = px.scatter(df ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@surchs thank you I should have thought of that!
So the python kernel that I run the jupyter server on is different than the python kernels I use in jupyter. I was assuming the install needed to be on the kernels being used in the notebook, not on the jupyter server’s kernel itself. That has resolved my issue.
@ahotrod @HaithamMaya: any chance you are running jupyter with more than one python kernel (i.e. https://ipython.readthedocs.io/en/stable/install/kernel_install.html)? If so, please ensure that the
jupyterlab-plotly
extension is available in the python environment you use to start jupyterlab.