[IPython-dev] rant: "%matplotlib inline"
Fernando Perez
fperez.net at gmail.com
Thu Jul 2 20:33:01 EDT 2015
Rant welcome! :)
Since you actually control the deployment environment, you can make
decisions for your users that are different from those we make in the
default definition of IPython itself.
For example, you can configure the system-wide installation to run
`%matplotlib inline` on startup, always. That would obviously preload
matplotlib for everyone, but in your case, that may be OK: you know that
numpy/mpl *are* installed, and that they run OK, so it's fine to try and
preload them for your users.
Or, slightly cleaner: you could install a little import hook that detects
the "import matplotlib" statement, and triggers the inline call at that
point. That would be 100% transparent for your users. It's not something
that we can do because it breaks when not imported from a notebook (aka the
IPython terminal with local floating windows). But in your case, you know
your users are only accessing it via notebooks, so you can make that
decision for them.
Hopefully this gives you some options...
Cheers,
f
On Thu, Jul 2, 2015 at 5:16 PM, William Stein <wstein at gmail.com> wrote:
> <Rant>
> Hi,
>
> I just want to register my frustration that by far the most common
> support request I get about IPython use in SageMathCloud is the
> following: "To display the plot, I'm tried to pl.show(), and also
> pl.savefig('test.png') as suggested by some answers online, but
> neither did the job. What is the correct command?"
>
> The answer is "%matplotlib inline", and there is a stackoverflow
> question here about it:
>
>
> http://stackoverflow.com/questions/19410042/how-to-make-ipython-notebook-inline-matplotlib-graphics
>
> I'm aware that disallowing the `--pylab inline` option when starting
> ipython on the command line was a choice that you made on purpose.
>
> No response required -- I'm just being a humble tech support person
> watching out for users :-)
>
> </Rant>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
--
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150702/0738de52/attachment.html>
More information about the IPython-dev
mailing list