Reputation: 744
I am using IPython. Got confused that the codes can't execute if I don't add
%matplotlib
before
import matplotlib.pyplot as plt
Could someone enlighten me by explaining why the magic function call in IPython is needed for matplotlib usage?
Upvotes: 0
Views: 203
Reputation: 48
I believe it's needed because normally matplotlib opens additional windows for graphs using a default toolkit. The %inline lets you load graphs in the IPython notebook, instead of using an external toolkit.
Upvotes: 3