[yt-users] How do I preview a plot?

Nathan Goldbaum nathan12343 at gmail.com
Mon Mar 6 08:30:26 PST 2017


Right, I actually brought this up with the matplotlib developers at the
scipy conference last year:

https://github.com/matplotlib/matplotlib/issues/6739

On Mon, Mar 6, 2017 at 8:27 AM (Jan) Christoph Bischko <
christoph.bischko at gmail.com> wrote:

> Nathan,
>
> thanks for the lightning-fast reply!
>
> On 06.03.2017 17:15, Nathan Goldbaum wrote:
> > Currently that's not supported outside of a Jupyter notebook.
> >
> > That said, in the next major release of yt (yt 3.4) we will add support
> > for this. If you'd like to try it out right now you'll need to install
> > yt from the "yt" branch of the mercurial repository. There are
> > instructions on how to build yt from source here:
> >
> >
> http://yt-project.org/docs/dev/installing.html#installing-yt-using-pip-or-from-source
> >
> > Here's some description in the docs for the in-development version of yt
> > where this feature is available already:
> >
> > http://yt-project.org/docs/dev/visualizing/plots.html#viewing-plots
> >
> > Basically you just do:
> >
> > import yt
> > yt.toggle_interactivity()
>
> Thank you Nathan, that is convenient and amazing.
>
> I just found http://yt-project.org/doc/visualizing/manual_plotting.html,
> which I will use as a workaround for the time being as I also need some
> (limited) backward-compatibility.
>
>
>
> > And the next time you call plot.show() it should pop up a GUI plot
> > window using your default matplotlib backend. Unfortunately we can't
> > make this behavior the default since yt is often used in headless ssh
> > sessions on a supercomputer where using an interactive GUI backend would
> > cause a crash.
>
> Unless you couple it with something like:
>
>     import os
>     if 'DISPLAY' not in os.environ: matplotlib.use('agg')
>
> Which, I admit, could be improved upon. However, there should be less
> crude hacks to detect the headless case.
>
> Regards,
> Christoph
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170306/a6807eda/attachment.html>


More information about the yt-users mailing list