简体   繁体   中英

Matplotlib plots not showing on Jupyter Notebook when I 'run all'

When the plots are not displayed inline -> %matplotlib notebook

The plots appear completely blank. Any ideas?

在这里看到

Came across the same issue on calling "Restart & Run all". Following this

%matplotlib notebook showing a blank histogram

I could resolve the issue adding

%matplotlib inline

at the beginning of the cell. Also note that you can prevent string output by adding ; to the end of a line.

I faced a similar issue with my Chrome Browser, whereas it works fine with Mozilla.

%matplotlib inline will lead to static images of your plot embedded in the notebook, so that cannot be the solution for this prevailing issue.

Had a similar issue - %matplotlib notebook command would not display the plot but %matplotlib inline would. Had to downgrade matplotlib version from 3.1.3 to 3.1.2.

Python 3.7.9, conda 4.5.11

If you're trying to create a graph using the Object-Oriented Interface try adding

fig, ax = plt.subplots() 

above your ax.plot

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM