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

Viewed 44397

The plots are not displayed inline in notebooks when using matplotlib

The plots appear completely blank. Any ideas?

seen here

4 Answers

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

Related