[yt-users] saving files with a different resolution

Luigi Iapichino luigi at ita.uni-heidelberg.de
Wed Mar 31 01:53:04 PDT 2010


Hi Matt,

both methods work, but I have a further problem: if I try to add density 
contours, they appear in the plot, but they are not superimposed at the 
correct location. They look like shifted, and I suppose that 

p.modify["contour"]("Density", ncont=5,take_log=True)

does not "see" that I changed the size of the figure.
Am I missing something?
Thanks,

  Luigi

On Tuesday 30 March 2010, Matthew Turk wrote:
> Hi Luigi,
>
> Yup, you'll just need to provide it with a new "figure".  In
> matplotlib, figures are the background - the entire image, if you will
> - and "axes" are individual plot elements on that.  Here we're going
> to create a figure with 100 dpi that's 12 inches by 9 inches -- this
> should be 1200 by 900 pixels:
>
> fig = raven.matplotlib.figure.Figure(dpi = 100, figsize = (12, 9))
> p = pc.add_projection("Temperature", 0, weight_field="Density")
>
> That's the slightly harder way -- you'll have to generate a new Figure
> object for every plot.  There's a shortcut in yt already, though, that
> accepts a figsize=(width, height) argument, where width and height are
> in inches:
>
> p = pc.add_projection("Temperature", 0, weight_field="Density",
> fig_size=(20, 16))
>
> if you wanted 2000 by 1600 pixels.
>
> Does that help out?
>
> Best,
>
> Matt
>
> On Tue, Mar 30, 2010 at 7:47 AM, Luigi Iapichino
>
> <luigi at ita.uni-heidelberg.de> wrote:
> > Dear all,
> >
> > in one of my scripts I have something like this:
> >
> >    pc = PlotCollection(pf, center=[0.5,0.5,0.5])
> >
> >    p = pc.add_projection("Temperature", 0, weight_field="Density")
> >    p.modify["contour"]("Density", ncont=5, take_log=True)
> >    ...
> >    ...
> >    ...
> >    pc.save("%s_temp-proj" % pf,override=True)
> >
> > The saved file has a resolution of 800x800. Is there a way to change this
> > number in YT? I had a look in the PlotCollection class, but I haven't
> > found what I'm searching.
> >
> > Looking forward to your suggestions,
> > Cheers
> >
> >  Luigi
> >
> > --
> >
> > ---------------------------------------------------------------
> >
> > Luigi Iapichino
> > Zentrum fuer Astronomie der Universitaet Heidelberg
> > Institut fuer Theoretische Astrophysik
> > Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany
> > Tel: +49 6221 548983, Fax: +49 6221 544221
> > e-mail: luigi at ita.uni-heidelberg.de
> > URL: http://www.ita.uni-heidelberg.de/~luigi/
> > _______________________________________________
> > 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



-- 

---------------------------------------------------------------

Luigi Iapichino
Zentrum fuer Astronomie der Universitaet Heidelberg
Institut fuer Theoretische Astrophysik
Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany
Tel: +49 6221 548983, Fax: +49 6221 544221
e-mail: luigi at ita.uni-heidelberg.de
URL: http://www.ita.uni-heidelberg.de/~luigi/



More information about the yt-users mailing list