[yt-users] plotting questions

Matthew Turk matthewturk at gmail.com
Tue Nov 24 10:53:08 PST 2009


Hi Shankar,

-Matt

On Tue, Nov 24, 2009 at 10:30 AM, Agarwal, Shankar <sagarwal at ku.edu> wrote:
> Hi Matt,
>
> So I tried to plot the velocity vectors. But they cover only 1/4th of the Box.

They cover the entire box, but they do not support periodicity.
You're centered in the lower left quadrant, so they only cover the
non-shifted regions.  If you want the velocity vectors to cover the
entire box, center at the center of the box -- then the entire region
will be non-shifted.

> And what can I do about "unitary" ?

Not sure I know what you mean -- you can use any units, but it
defaults to the entire box.  For instance.

pc.set_width(100, "mpc")

will set the viewing plane width to 100 proper Mpc (not over h.)


-Matt

>
> pf = load("RedshiftOutput0002")
> pc = PlotCollection(pf)
> for ax in range(3):
>   p = pc.add_slice("Density", ax)
>   p.modify["grids"]()
>   p.modify["contour"]("Density",ncont=4,take_log=True,clim=(1e-28,1e-30))
>   p.modify["velocity"](factor=16)
>   p.modify["coord_axes"](unit="Mpc")
> pc.save("plot2")
>
> shankar
>
>
>
>
> -----Original Message-----
> From: yt-users-bounces at lists.spacepope.org on behalf of Matthew Turk
> Sent: Tue 11/24/2009 11:05 AM
> To: Discussion of the yt analysis package
> Subject: Re: [yt-users] plotting questions
>
> Hi Shankar,
>
>> Also, I am not able to loop over method 1. I am using the stupid way as shown below.
>
> Sure you can loop!  :)  Here's a way to do it:
>
> for ax in range(3):
>    p = plots.get_slice("RedshiftOutput0002", "Density", ax)
>    p.modify["grids"]()
>    p.modify["contours"]("Density")
>    p.save_image("something_%s" % ax)
>
> That last line will make sure that your images have different names --
> and that's actually what's going wrong with the second loop that you
> had below.
>
> (I'd like to note that having similar plots on different axes is why
> the Plot Collection is around -- so I'd suggest you stick to that, as
> it will make changing widths and whatnot easier.)
>
>> And method 2 is not showing the grids.
>> for ax in range(3):
>>    pc.add_slice("Density", ax).modify["grids"]()
>>    pc.add_slice("Density", ax).modify["contour"]("Density")
>> pc.save("plot2")
>
> Ah!  What's going on here is that the plot collection, at the end of
> the loop, has *six* plots:
>
> slice on x with grids
> slice on x with contours
> slice on y with grids
> slice on y with contours
> slice on z with grids
> slice on z with contours
>
> BUT, the callbacks aren't taken into account when creating image file
> names.  So it just overwirtes the first slice with the second, the
> third with the fourth, and the fifth with the sixth.  What you
> probably want to do is:
>
> for ax in range(3):
>    p = pc.add_slice("Density", ax)
>    p.modify["grids"]()
>    p.modify["contour"]("Density")
> pc.save("plot2")
>
> This way you're modifying the same plot object with both grids and contours.
>
> Best of luck,
>
> Matt
> _______________________________________________
> 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
>
>



More information about the yt-users mailing list