Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot inside Ipython Notebook

I'm using IPython notebooks to share code and (hopefully) graphics with m collaborators. sadly, I cannot get matplotlib to plot inside the notebook, it always gives me a pop-up window, which I obviously cannot include in notebook pastes or similar.

Here's two minimal examples of how I go about plotting things.

Either with invoking plt.show() , or without it.

this either gives me an external pop-up, or plots nothing.

like image 747
TheChymera Avatar asked Jan 18 '26 14:01

TheChymera


1 Answers

You need to be using the matplotlib inline backend.

%matplotlib inline
like image 138
Andrew Walker Avatar answered Jan 20 '26 07:01

Andrew Walker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!