Offline mode not displaying inline in Jupyter notebook master?
See original GitHub issueI hadn’t tested recently, but today, using master of the Jupyter notebook, I can’t get offline plots to display inline, instead I get the external temporary file. Consider this simple test:
from plotly import __version__
from plotly.offline import init_notebook_mode, plot
from plotly.graph_objs import Scatter
init_notebook_mode()
print("plotly version:", __version__)
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
I get for output:
plotly version: 1.9.10
Out[1]: 'file:///Users/fperez/tmp/temp-plot.html'
and the plot correctly opening in a new tab by itself, but no inline notebook output. Here’s a screenshot for reference:
In the JS console, I don’t see anything that immediately points to the problem. Here’s a screenshot, b/c copy-pasting text from the JS console makes a mish-mash of the formatting:
The above were from current Chrome on OSX, but I replicated the problem on Safari.
Any thoughts on how to proceed much appreciated. Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:41 (3 by maintainers)
Top Results From Across the Web
plot.ly offline mode in jupyter lab not displaying plots
A couple things might be happening. For some reason is your Notebook "Not Trusted?" This will stop the Plotly javascript from rendering ...
Read more >Jupyter notebook tutorial in Python - Plotly
Jupyter notebook tutorial on how to install, run, and use Jupyter for interactive ... plotly.plotly.iplot() or plotly.offline.iplot() if working offline.
Read more >Jupyter Notebook 6.5.2 documentation - Read the Docs
A web application: a browser-based tool for interactive authoring of documents which combine explanatory text, mathematics, computations and their rich media ...
Read more >The Ultimate Markdown Guide (for Jupyter Notebook) - Medium
You simply use HTML for any Markup that is not covered by the Markdown syntax. You don't need to preface it or delimit...
Read more >Plotly - Plotting Inline with Jupyter Notebook - Tutorialspoint
Keep rest of the script as it is and run the notebook cell by pressing Shift+Enter. Graph will be displayed offline inside the...
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
@edoson
Oddly, this only occurs for me in Notebooks with very high memory usage (10+ GB) and LOTs of plots. I have found, for whatever reason, that running the Notebook cell-by-cell also helps (as opposed to “Restart and Run All”).
Here’s the steps I use:
Open Notebook (might have been saved with plots there);
Restart and Clear Output;
Save the Notebook;
Hard Refresh of browser;
Run Notebook cell-by-cell.
In newer jupyter versions, the requirejs error might be because of notebook trust. When the notebook considers the .ipynb untrusted, it will not run javascript on initialization. This interferes with the way that plotly gets injected into the jupyter notebook.
If that is the issue, clicking the button in the top right of the notebook to “trust” the ipynb may fix it. Installing & configuring the nbextension might help too.