<div dir="ltr"><div><div>Hi and thanks for your help<br><br></div>I managed to solve the problem by calling _setup_plots fof all yt plots before passing them to insert_image_yt or axis_box_yt, that seems to validate them. I'll create a pull request so you can review my changes.<br><br></div>Anni<br></div><br><div class="gmail_quote"><div dir="ltr">ma 3. elokuuta 2015 klo 19.03 John Wise <<a href="mailto:jwise@physics.gatech.edu">jwise@physics.gatech.edu</a>> kirjoitti:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Anni,<br>
<br>
I just wanted to echo Nathan's and Matt's comments and say that<br>
eps_writer relies on the image and axes ranges that are stored in the<br>
PlotWindow.  So if the image hasn't been updated with the new colormap,<br>
ranges, etc., which happens just before the image is created, the<br>
original image will be inserted into the eps_writer framework.<br>
<br>
If you need any help with creating this pull request, please let us know!<br>
<br>
Thanks,<br>
John<br>
<br>
On 08/03/2015 10:25 AM, Nathan Goldbaum wrote:<br>
> It's because the plots are not actually created until they are about to<br>
> be saved to disk. This was a performance improvement that was added more<br>
> recently tha. The eps writer and it looks like the eps writer was never<br>
> updated to handle it.<br>
><br>
> Take a look at the validate_plot decorator in<br>
> yt/visualization/plot_container.py, any function decorated with this<br>
> will make sure the matplotlib figure and axes exist and have a valid plot.<br>
><br>
> I agree with Matt that this sounds like a great addition, very much<br>
> looking forward to the pull request!<br>
><br>
> On Monday, August 3, 2015, Matthew Turk <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a><br>
> <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>>> wrote:<br>
><br>
>     Hi Anni,<br>
><br>
>     I think it's just an issue with how the plots are generated -- saving<br>
>     makes sure they are the latestversion.  I think it would be great to<br>
>     push something to warn the user if it hasn't been set up yet!<br>
><br>
>     -MAtt<br>
><br>
>     On Mon, Aug 3, 2015 at 7:45 AM, Anni Järvenpää<br>
>     <<a href="mailto:anni.jarvenpaa@gmail.com" target="_blank">anni.jarvenpaa@gmail.com</a> <javascript:;>> wrote:<br>
>      > Hi All,<br>
>      ><br>
>      > I have been updating the eps_writer to handle a mixture of<br>
>     profiles, slices<br>
>      > and projections that can be displayed in a single plot (multiple<br>
>     panels).<br>
>      > eps_writer with my edits can be reviewed at<br>
>      > <a href="http://paste.yt-project.org/show/5773/" rel="noreferrer" target="_blank">http://paste.yt-project.org/show/5773/</a>. However, in order to get<br>
>     the plot<br>
>      > axes to work correctly I need to save the individual plots as<br>
>     well before<br>
>      > passing them to the eps_writer.<br>
>      ><br>
>      > Here is an example script:<br>
>     <a href="http://paste.yt-project.org/show/5772/" rel="noreferrer" target="_blank">http://paste.yt-project.org/show/5772/</a>. It works<br>
>      > correctly as is, but uncommenting the changes in plots causes<br>
>     weird results<br>
>      > if I don't also save the individual plots. The result of saving and<br>
>      > not-saving are below (as you can see the plot doesn't change but the<br>
>      > axes/colorbar does).<br>
>      > <a href="http://www.mv.helsinki.fi/home/aajarven/yt/noedit.png" rel="noreferrer" target="_blank">http://www.mv.helsinki.fi/home/aajarven/yt/noedit.png</a><br>
>      > <a href="http://www.mv.helsinki.fi/home/aajarven/yt/edits-nosave.png" rel="noreferrer" target="_blank">http://www.mv.helsinki.fi/home/aajarven/yt/edits-nosave.png</a><br>
>      > <a href="http://www.mv.helsinki.fi/home/aajarven/yt/edits-save.png" rel="noreferrer" target="_blank">http://www.mv.helsinki.fi/home/aajarven/yt/edits-save.png</a><br>
>      ><br>
>      > Does anyone know why the plots must be saved before being handed<br>
>     to the<br>
>      > eps_writer api?<br>
>      > I'd like to push these changes to the eps_writer and could<br>
>     possibly raise<br>
>      > the save as a bug?<br>
>      ><br>
>      > Let me know.<br>
>      ><br>
>      > Anni<br>
>      ><br>
>      > _______________________________________________<br>
>      > yt-users mailing list<br>
>      > <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a> <javascript:;><br>
>      > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>      ><br>
>     _______________________________________________<br>
>     yt-users mailing list<br>
>     <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a> <javascript:;><br>
>     <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
<br>
--<br>
John Wise<br>
Assistant Professor of Physics<br>
Center for Relativistic Astrophysics, Georgia Tech<br>
<a href="http://cosmo.gatech.edu" rel="noreferrer" target="_blank">http://cosmo.gatech.edu</a><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div>