[yt-users] set_xlim() and set_ylim() problem

Noel Scudder noel.scudder at stonybrook.edu
Wed Jul 17 09:34:26 PDT 2013


Hi Nathan,

Thanks for your advice. My line plot is now behaving, and I was able to
take advantage of a few other extra options pylab provides. I'm glad that
didn't take much!

-Noel

On Tue, Jul 16, 2013 at 5:51 PM, Nathan Goldbaum <nathan12343 at gmail.com>wrote:

> Hi Noel,
>
> I would create the ray object and plot by hand, rather than relying on
> PlotCollection:
>
> pf = load(...)
> ray = pf.h.ray([0.0, 5.0e9, 5.0e9],[1.e10, 5.0e9, 5.0e9])
>
> data = ray['logden']
> t = ray['t']
>
> import pylab
> pylab.plot(t, data)
>
> Of course you'll need to set your own axes labels this way but it should
> be a lot more flexible.
>
> -Nathan
>
>
> On Tue, Jul 16, 2013 at 2:38 PM, Noel Scudder <noel.scudder at stonybrook.edu
> > wrote:
>
>> Hi yt-users,
>>
>> I've got another hopefully quick problem I'm looking for help with
>> (thanks for bearing with me with all of my emails!).
>> I'm trying to create a line plot through 'add_ray' in a PlotCollection.
>> It is created just fine, but I can't seem to set the x and y limits of the
>> plot. Neither pc.set_xlim() nor ray.set_xlim() (along with the y-axis
>> versions) do anything.
>> Here is my script:
>>
>> ---------------------
>> from yt.mods import *
>> pf = load("plt00500")
>>
>> pc = PlotCollection(pf, 'c')
>> ray = pc.add_ray([0.0, 5.0e9, 5.0e9],[1.e10, 5.0e9, 5.0e9], 'logden')
>>
>> pc.set_ylim(-5.0, 8.0)
>> pc.set_xlim(0.2, 0.5)
>>
>> pc.save('ray')
>>
>> ---------------------
>>
>> But my image remains unchanged: http://i.imgur.com/1jPzHbt.png
>>
>> What am I missing here? Is it not possible to set the limits on such a
>> plot? Thanks in advance for your help.
>>
>> -Noel Scudder
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> 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/20130717/41f54cf1/attachment.html>


More information about the yt-users mailing list