-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove instances of %matplotlib inline
#9
Comments
You should note in these lessons that But this is part of a more complicated issue; it would be worth looking at the docs on interactive mode for seeing what exactly it means to not be running in interactive mode.
Actually, the problem here is not just that it's ipython specific; that is, it will also fail if you run After a discussion today with @fperez, @Carreau, @JamiesHQ and @ian-r-rose, the current plan does not include fixing the general Note, if all you want to do is to get images out of a notebook outputs you should be able to use the |
@hlapp what do you think about me removing the use of |
I think that would be great. The cell magics may be worthwhile material in a course teaching chiefly Jupyter and/or Python. But for this curriculum, the overarching subject is reproducible research, or more concretely, practices using Jupyter Notebooks that make your computational research more reproducible. If cell magics occur we would not normally explain them or what exactly they do, because that would mostly be a distraction from what we're really trying to teach here. Also, by their very nature (inducing behavior that's not reproducible outside of a Jupyter notebook) they're not exactly consistent with the subject we are teaching. So replacing them with something that requires less special explanation, and that can run with Python even if the Jupyter NB environment is peeled away, would seem broadly desirable to me. So long, as seems to be the case here, as satisfying the required dependencies doesn't take jumping through many additional hoops. |
Thanks @choldgraf & @hlapp - sounds like a good workaround for the purposes of the lesson. Let me know if Chris' solution is satisfactory enough to close the issue - or @choldgraf you can do it! This isn't Jupyterland! |
I'll make a PR to do this soon, let's close this issue once that gets merged :) |
actually I just took a look through some notebooks and this is going to take a little bit of time...some of the weeks are not super clearly organized to me and it's also a little unclear where there is matplotlib stuff going on and where there isn't. I'll make any edits as I look through the materials I'll use next but I don't have the time to go through each notebook individually right now. |
@choldgraf that makes sense. There is discussion around doing another pilot partnered with a working session, so we can tag it as a to-do before then. |
See here for a discussion of this. Basically, when we use
%matplotlib inline
it tends to create confusion when exporting notebooks topython
scripts (because this line will cause python to break, since it's ipython-specific).I think the jupyter team is working to auto-convert these kinds of one-liners, but I think in the meantime we should discourage the use of
%matplotlib inline
to avoid this problem.One solution is to:
plt.ion()
at the beginning of scripts, which causes plots to show up automaticallyWhat do people think about this? I think it's a fine solution if we assume people are using MPL 2.0.
The text was updated successfully, but these errors were encountered: