[yt-users] Plot collections on non-square slices

Nathan Goldbaum nathan12343 at gmail.com
Tue Jul 24 16:29:38 PDT 2012


Hi Mark,

You can manually specify the size of the figure that will be created by setting the fig_size keyword.  For example:

pf = load(fn)

pc = PlotCollection(pf)

fig_size = [4, 3]  # the figure size in inches

pc.add_slice('Density',0,fig_size = fig_size)

pc.save() # saves a slice of Density that is 4 x 3 inches.

Hope that was helpful.

-Nathan

On Jul 24, 2012, at 3:55 PM, Mark Krumholz wrote:

> 
> Hi YT Users,
> 
> I have a computational domain that is not cubical, and I want to plot a slice through it that is rectangular rather than square. I can make a slice with PlotCollection, but when I write the image to a file using save, I find that it has been padded with whitesapce on the left and right to make it square. I would like the image to have the same aspect ratio as the data, not be white-padded. Is there a way to do this with PlotCollection, or should I just give up and use FixedResolutionBuffer to extract the data and construct the image myself?
> 
> Thanks.
> 
> --
> Mark Krumholz
> krumholz at ucolick.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