[yt-users] Why individual plots have to be saved before being handed to eps_writer?

Nathan Goldbaum nathan12343 at gmail.com
Mon Aug 3 07:25:09 PDT 2015


It's because the plots are not actually created until they are about to be
saved to disk. This was a performance improvement that was added more
recently tha. The eps writer and it looks like the eps writer was never
updated to handle it.

Take a look at the validate_plot decorator in
yt/visualization/plot_container.py, any function decorated with this will
make sure the matplotlib figure and axes exist and have a valid plot.

I agree with Matt that this sounds like a great addition, very much looking
forward to the pull request!

On Monday, August 3, 2015, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Anni,
>
> I think it's just an issue with how the plots are generated -- saving
> makes sure they are the latestversion.  I think it would be great to
> push something to warn the user if it hasn't been set up yet!
>
> -MAtt
>
> On Mon, Aug 3, 2015 at 7:45 AM, Anni Järvenpää <anni.jarvenpaa at gmail.com
> <javascript:;>> wrote:
> > Hi All,
> >
> > I have been updating the eps_writer to handle a mixture of profiles,
> slices
> > and projections that can be displayed in a single plot (multiple panels).
> > eps_writer with my edits can be reviewed at
> > http://paste.yt-project.org/show/5773/. However, in order to get the
> plot
> > axes to work correctly I need to save the individual plots as well before
> > passing them to the eps_writer.
> >
> > Here is an example script: http://paste.yt-project.org/show/5772/. It
> works
> > correctly as is, but uncommenting the changes in plots causes weird
> results
> > if I don't also save the individual plots. The result of saving and
> > not-saving are below (as you can see the plot doesn't change but the
> > axes/colorbar does).
> > http://www.mv.helsinki.fi/home/aajarven/yt/noedit.png
> > http://www.mv.helsinki.fi/home/aajarven/yt/edits-nosave.png
> > http://www.mv.helsinki.fi/home/aajarven/yt/edits-save.png
> >
> > Does anyone know why the plots must be saved before being handed to the
> > eps_writer api?
> > I'd like to push these changes to the eps_writer and could possibly raise
> > the save as a bug?
> >
> > Let me know.
> >
> > Anni
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org <javascript:;>
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org <javascript:;>
> 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/20150803/cca4d4db/attachment.html>


More information about the yt-users mailing list