In IPython Notebook, I defined a function that contains a call to the magic function %matplotlib
, like this:
def foo(x):
%matplotlib inline
# ... some useful stuff happens in between here
imshow(np.asarray(img))
I'd like to put that function into a Python module so that I can just import and call it.
However, to do this, I'd need to remove the %matplotlib inline
from my code and replace it with its pure-Python equivalent.
What is the pure-Python equivalent?