<div dir="ltr">Just figured out that plot.reset_plot() option was stopping me from overwriting the labels.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 6:58 PM, Latif <span dir="ltr"><<a href="mailto:latifne@gmail.com" target="_blank">latifne@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Nathan,<br></div>Thank you!<br> I am trying to make phase plot but wanted to change the axis labels and fonts etc. It is very simple script and should have worked as I followed the discussion on this thread.  My y-axis label command is simply being ignored. Any thoughts on this?<br>

 plot = PhasePlot(dd, "Density", "Temperature", "CellMassMsun",<br>                 weight_field=None, fractional=True)<div class=""><br>ax = plot.plots['CellMassMsun'].axes<br></div>
ax.set_ylabel(r'$\mathrm{Density [g/cm^{3}]}$')<br>
plot.reset_plot()<br>plot.save()<br></div>Cheers<span class="HOEnZb"><font color="#888888"><br>Latif<br><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 15, 2014 at 6:53 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Latif,<div><br></div><div>Can you give a little more detail about the problem you're having.  Specifically, can you write a short script that isn't working for you?  If you see any traceback errors can you also paste the full traceback?</div>

<span><font color="#888888">

<div><br></div><div>-Nathan</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 9:16 AM, Latif <span dir="ltr"><<a href="mailto:latifne@gmail.com" target="_blank">latifne@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all,<br></div>I am still having the same problem which Stephanie pointed out. Label setting is not working with the following version of YT. Any ideas what is going wrong here?<br>



<br>Version = 2.7-dev<br>
Changeset = c03ad444c015<br></div>Thanks in advance,<br></div>Cheers<span><font color="#888888"><br>Latif</font></span><div><div><br><div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Tue, Jan 28, 2014 at 9:47 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">PR has been merged:<br>
<a href="https://bitbucket.org/yt_analysis/yt/pull-request/696/fixing-an-issue-with-_plot_valid-never/diff" target="_blank">https://bitbucket.org/yt_analysis/yt/pull-request/696/fixing-an-issue-with-_plot_valid-never/diff</a><br>





<br>
Thanks, Matt!<br>
<div><div><br>
On Tue, Jan 28, 2014 at 12:35 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>> wrote:<br>
> I'll be PRing into 2.7dev, so no worries - my working copy just<br>
> happened to be 3.0dev when I saw your e-mail.<br>
><br>
> Once my patch is accepted, you'll probably need to revert the manual<br>
> change you made:<br>
><br>
> $ hg revert --all<br>
><br>
> And then update:<br>
><br>
> $ yt update<br>
><br>
> If you didn't revert the change, yt would print instructions on how to<br>
> update manually (to account for the local changes in your copy).<br>
><br>
> I'll reply to this thread once the PR is accepted.<br>
><br>
> -Nathan<br>
><br>
> On Tue, Jan 28, 2014 at 12:28 PM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>> wrote:<br>
>> Genius!  Yes, this did work.  I am running yt 2.7dev, so as you said, the<br>
>> line numbers were a bit different.  If you open a PR for this patch, when it<br>
>> gets accepted what gets updated?  More specifically, will it get added to<br>
>> *my* yt when I type yt update?<br>
>><br>
>><br>
>> On Tue, Jan 28, 2014 at 3:16 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> It should be working.  You're actually directly manipulating the<br>
>>> matplotlib axes object so this has nothing to do with what has or<br>
>>> hasn't been implemented in yt.<br>
>>><br>
>>> It looks like the issue is actually due to an oversight in the<br>
>>> implementation of PhasePlot._setup_plots().<br>
>>><br>
>>> I've fixed it in my local copy by doing the following:<br>
>>><br>
>>> diff -r ff7f35e02f27 yt/visualization/profile_plotter.py<br>
>>> --- a/yt/visualization/profile_plotter.py       Mon Jan 27 11:52:18 2014<br>
>>> -0500<br>
>>> +++ b/yt/visualization/profile_plotter.py       Tue Jan 28 12:13:42 2014<br>
>>> -0800<br>
>>> @@ -653,6 +653,7 @@<br>
>>>                    [ax.xaxis.label, ax.yaxis.label, cbax.yaxis.label]<br>
>>>                  for label in labels:<br>
>>>                      label.set_color(self._font_color)<br>
>>> +        self._plot_valid = True<br>
>>><br>
>>>      def save(self, name=None, mpl_kwargs=None):<br>
>>>          r"""<br>
>>><br>
>>><br>
>>> This is in yt 3.0dev, so your line numbers may be slightly different<br>
>>> if you're running the yt 2.6.1 release.<br>
>>><br>
>>> Let me know if that works for you and I'll open a PR for this patch.<br>
>>><br>
>>> -Nathan<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> On Tue, Jan 28, 2014 at 11:55 AM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> wrote:<br>
>>> > Hi Nathan,<br>
>>> ><br>
>>> > Thanks!  I am no longer getting a Key Error, but the commands are simply<br>
>>> > being ignored.  Has this axis functionality been added to PhasePlot?<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > On Tue, Jan 28, 2014 at 1:00 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> Hi Stephanie,<br>
>>> >><br>
>>> >> Phase plots are keyed with the z axis name.  Try:<br>
>>> >><br>
>>> >> ax = plot.plots['CellMassMsun'].axes<br>
>>> >><br>
>>> >> -Nathan<br>
>>> >><br>
>>> >> On Tue, Jan 28, 2014 at 7:09 AM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> >> wrote:<br>
>>> >> > Hi John (and all users!),<br>
>>> >> ><br>
>>> >> > Thanks, this definitely worked!  Now I am trying to make my axes look<br>
>>> >> > a<br>
>>> >> > bit<br>
>>> >> > nicer.  I would like to change my y-axis label and rotate my x-axis<br>
>>> >> > ticklabels by 45 degrees or only print every other ticklabel.  I<br>
>>> >> > tried<br>
>>> >> > to<br>
>>> >> > use the directions from the SlicePlot example,<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > <a href="http://yt-project.org/docs/dev/cookbook/simple_plots.html#showing-and-hiding-axes-labels-and-colorbars" target="_blank">http://yt-project.org/docs/dev/cookbook/simple_plots.html#showing-and-hiding-axes-labels-and-colorbars</a>,<br>





>>> >> ><br>
>>> >> > plot =<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > PhasePlot(tracerp25,"Density","z-velocity",["CellMassMsun"],weight_field=None,fontsize=13)#,x_bounds=[3e-28,5e-23],y_bounds=[-7e7,1.2e8])<br>
>>> >> ><br>
>>> >> > plot.set_log("Density",True)<br>
>>> >> > plot.set_log("z-velocity",False)<br>
>>> >> > plot.set_zlim("CellMassMsun",1e4,1e9)<br>
>>> >> > plot.set_figure_size(3)<br>
>>> >> ><br>
>>> >> > ax = plot.plots['z-velocity'].axes<br>
>>> >> > ax.set_ylabel(r'z-velocity (10$8$ cm/s)')<br>
>>> >> > for label in ax.xaxis.get_ticklabels():<br>
>>> >> >     label.set_rotation(45)<br>
>>> >> ><br>
>>> >> > plot.save()<br>
>>> >> ><br>
>>> >> > but get an error message:<br>
>>> >> ><br>
>>> >> > ax = plot.plots['z-velocity'].axes<br>
>>> >> > KeyError: 'z-velocity'<br>
>>> >> ><br>
>>> >> > I get the same error if I use 'Density' on that line instead.<br>
>>> >> ><br>
>>> >> > Thanks in advance,<br>
>>> >> ><br>
>>> >> > Stephanie<br>
>>> >> ><br>
>>> >> ><br>
>>> >> ><br>
>>> >> > On Mon, Jan 27, 2014 at 11:31 AM, John ZuHone <<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>><br>
>>> >> > wrote:<br>
>>> >> >><br>
>>> >> >> Stephanie,<br>
>>> >> >><br>
>>> >> >> So you don't have to wait for me to finish this, as a<br>
>>> >> >> workaround/hack<br>
>>> >> >> you<br>
>>> >> >> can do this:<br>
>>> >> >><br>
>>> >> >> pf.field_info["Density"].take_log=True<br>
>>> >> >><br>
>>> >> >> which should get you the result you want.<br>
>>> >> >><br>
>>> >> >> Best,<br>
>>> >> >><br>
>>> >> >> John<br>
>>> >> >><br>
>>> >> >> On Jan 26, 2014, at 3:38 PM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> >> >> wrote:<br>
>>> >> >><br>
>>> >> >> Sweet!  Thanks!  (I really need to update more often and see what<br>
>>> >> >> new<br>
>>> >> >> cool<br>
>>> >> >> things I can do...)<br>
>>> >> >><br>
>>> >> >> Stephanie<br>
>>> >> >><br>
>>> >> >><br>
>>> >> >> On Sun, Jan 26, 2014 at 3:34 PM, John ZuHone <<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>><br>
>>> >> >> wrote:<br>
>>> >> >>><br>
>>> >> >>> Hi Stephanie,<br>
>>> >> >>><br>
>>> >> >>> Ah yes, this is a problem I encountered just on Friday. We haven't<br>
>>> >> >>> set<br>
>>> >> >>> up<br>
>>> >> >>> PhasePlot or ProfilePlot to allow you to choose what scaling the<br>
>>> >> >>> plot<br>
>>> >> >>> is in.<br>
>>> >> >>><br>
>>> >> >>> Since I need it too, it was already on my todo list. So I'll do it<br>
>>> >> >>> tomorrow.<br>
>>> >> >>><br>
>>> >> >>> Best,<br>
>>> >> >>><br>
>>> >> >>> John<br>
>>> >> >>><br>
>>> >> >>> On Jan 26, 2014, at 3:32 PM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> >> >>> wrote:<br>
>>> >> >>><br>
>>> >> >>> Hi John,<br>
>>> >> >>><br>
>>> >> >>> Ah, okay!  Updating my yt made it work.  yt version 2.7-dev.<br>
>>> >> >>><br>
>>> >> >>> EXCEPT that I can't get it to plot the Density on the x-axis in log<br>
>>> >> >>> space!<br>
>>> >> >>><br>
>>> >> >>> alld = pf.h.all_data()<br>
>>> >> >>><br>
>>> >> >>> tracerp25 = alld.cut_region(["grid['specific_scalar[0]'] > 0.5",<br>
>>> >> >>> "grid['z'] < 0.192","grid['z'] > -0.192","grid['cyl_RCode'] <<br>
>>> >> >>> 1.2"])<br>
>>> >> >>><br>
>>> >> >>> plot =<br>
>>> >> >>><br>
>>> >> >>><br>
>>> >> >>> PhasePlot(tracerp25,"Density","z-velocity",["CellMassMsun"],weight_field=None,fontsize=30)<br>
>>> >> >>> plot.set_log("Density",True)<br>
>>> >> >>> plot.set_log("z-velocity",False)<br>
>>> >> >>> plot.set_zlim("CellMassMsun",1e3,1e9)<br>
>>> >> >>> plot.save()<br>
>>> >> >>><br>
>>> >> >>> Any more advice?  Thanks!<br>
>>> >> >>><br>
>>> >> >>> Stephanie<br>
>>> >> >>><br>
>>> >> >>><br>
>>> >> >>> On Sun, Jan 26, 2014 at 10:44 AM, John ZuHone <<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>><br>
>>> >> >>> wrote:<br>
>>> >> >>>><br>
>>> >> >>>> Hi Stephanie,<br>
>>> >> >>>><br>
>>> >> >>>> What is your version of yt? PhasePlot is 2.6 and later.<br>
>>> >> >>>><br>
>>> >> >>>> Best,<br>
>>> >> >>>><br>
>>> >> >>>> John<br>
>>> >> >>>><br>
>>> >> >>>> On Jan 26, 2014, at 10:42 AM, Stephanie Tonnesen<br>
>>> >> >>>> <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> >> >>>> wrote:<br>
>>> >> >>>><br>
>>> >> >>>> Hi all,<br>
>>> >> >>>><br>
>>> >> >>>> Just as a quick update, I tried to change to using<br>
>>> >> >>>><br>
>>> >> >>>> plot =<br>
>>> >> >>>><br>
>>> >> >>>><br>
>>> >> >>>> PhasePlot(tracerp25,"Density","z-velocity",["CellMassSolar"],weight=None)<br>
>>> >> >>>> plot.save()<br>
>>> >> >>>><br>
>>> >> >>>> and got an error:  name 'PhasePlot' is not defined.<br>
>>> >> >>>><br>
>>> >> >>>> Thanks,<br>
>>> >> >>>><br>
>>> >> >>>> Stephanie<br>
>>> >> >>>><br>
>>> >> >>>><br>
>>> >> >>>> On Fri, Jan 24, 2014 at 3:47 PM, Stephanie Tonnesen<br>
>>> >> >>>> <<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>><br>
>>> >> >>>> wrote:<br>
>>> >> >>>>><br>
>>> >> >>>>> Hi all,<br>
>>> >> >>>>><br>
>>> >> >>>>> I am trying to make my phase plots smaller so they can fit more<br>
>>> >> >>>>> nicely<br>
>>> >> >>>>> into a paper.  Alternatively, I would be fine with upping the<br>
>>> >> >>>>> font<br>
>>> >> >>>>> size so<br>
>>> >> >>>>> when I shrink them you can read the axes.  I found advise on how<br>
>>> >> >>>>> to<br>
>>> >> >>>>> do this<br>
>>> >> >>>>> for slices, but not for phase_objects.<br>
>>> >> >>>>><br>
>>> >> >>>>> pc = PlotCollection(pf)<br>
>>> >> >>>>><br>
>>> >> >>>>> tracerp25 = alld.cut_region(["grid['specific_scalar[0]'] > 0.5",<br>
>>> >> >>>>> "grid['z'] < 0.192","grid['z'] > -0.192","grid['cyl_RCode'] <<br>
>>> >> >>>>> 1.2"])<br>
>>> >> >>>>><br>
>>> >> >>>>><br>
>>> >> >>>>><br>
>>> >> >>>>><br>
>>> >> >>>>> pc.add_phase_object(tracerp25,["Density","z-velocity","CellMassSolar"],weight=None,x_bins=50,y_bins=50,y_bounds<br>
>>> >> >>>>> = [-4e7,8e7],x_bounds=[5e-28,5e-23],x_log=True,y_log=False)<br>
>>> >> >>>>><br>
>>> >> >>>>> Any help is much appreciated!<br>
>>> >> >>>>><br>
>>> >> >>>>> Thanks,<br>
>>> >> >>>>><br>
>>> >> >>>>> Stephanie<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" 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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><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" 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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><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" 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" 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" 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><br>
>>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" 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" 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><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" 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" 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><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>
<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
</div></div><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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>