Plots appear twice in notebooks
See original GitHub issueEvery call to a plotting function produces two plots in a notebook, e.g.:

This is because our functions return the figure, which then automatically gets plotted in a notebook. In addition, we also see the plot which is explicitly produced by the function.
I don’t think _ = XXXX.plot() or XXXX.plot(); are good solutions (pretty ugly). The only way this works nicely is XXXX.plot(show=False).
Could we somehow fix this weird behavior? By weird I mean (1) there are either two figures (show=True) or (2) there is one figure but show=False sounds like there should be none.
What about setting show=False by default only in a notebook environment?
Issue Analytics
- State:
- Created a year ago
- Comments:40 (40 by maintainers)
Top Results From Across the Web
Why is Jupyter showing charts twice? - python - Stack Overflow
It's working, but every time I plot a chart, the chart shows up twice. The first two charts in my notebook are plotted...
Read more >Duplicate Plots, notebook displays twice · Issue #1265 - GitHub
Display is up to the user. The problem is an ipython setting that displays it automatically (twice).
Read more >Any way to repeat a plot? : r/IPython - Reddit
I'm working on a slide show using an IPython notebook where I have a complicated plot created on one slide. But I would...
Read more >Matplotlib graphs are being duplicated each time
I have the issue that anything I plot appears twice. I am not sure why this is happening, so I am looking for...
Read more >About Jupyter Notebooks - AHA - Precision Medicine Platform
... Pretty Display of Variables; Easy links to documentation; Plotting in notebooks ... D + D (press the key twice) to delete 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 Free
Top 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
I think we are at least partly to blame. If you do
in a notebook, you only see the figure once, because the plotting function does not return the figure, but some sort of line collection. This is also what they recommend (
plotdoes not return aFigure), so I think it’s also the returning a Figure part that’s causing this issue specifically.Haha it’s kinda funny to see how the perception of what is and what is not correct behavior has changed over the past two years 😃