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

Nathan Goldbaum nathan12343 at gmail.com
Tue Jul 16 14:51:09 PDT 2013


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130716/c7378adc/attachment.html>


More information about the yt-users mailing list