[yt-users] Multiplot Phaseplot

Matthew Turk matthewturk at gmail.com
Tue Jun 7 20:20:03 PDT 2011


Hi Christine and Charles,

This is something I've been looking at recently.  The PlotCollection
as a whole has not aged ... particularly well.  It was designed for a
mode of operation which is 4 years obsolete at this point.  To that
end, I've been working on isolated phase and profile plots, and Jeff
Oishi has been working on the Plot Window.  These are designed to be
independent of Plot Collections, and are supposed to be more agile;
more control is left to the user for setting up contexts, and fewer
knobs and twiddles will be provided, on the basis that ... it's hard
to get that right reliably.

The phase plots and profile plots currently work, and I have been
using them for a paper I am currently writing.  I've also figured out
how to correlated colorbars across image plots of projections&slices,
if you end up needing any code for that, inside the multiplot context.

The sample script I came up with for generating phase plots is here:

http://paste.enzotools.org/show/1689/

The idea here is that it creates a figure, and then for each plot it
creates a new subplot, into which it plots our plot.  You can then use
the standard Matplotlib colors and limits and so on and so forth.

Hope that helps,

Matt

On Tue, Jun 7, 2011 at 4:08 PM, Charles Hansen
<chansen at astro.berkeley.edu> wrote:
> It is kinda tricky.  With everything except for phaseplot, you can use
> something like...
>
> (using matplotlib)
>
> pc = PlotCollection(....)
> subplot(211)
> fig1 = gcf()
> axis1 = gca()
> p = pc.add_slice(...., figure=fig1, axes=axis1, use_colorbar=False)
>
> suplot(212)
> fig2 = gcf()
> axis2 = gca()
> p = pc.add_slice(...., figure=fig2, axes=axis2, use_colorbar=False)
>
> With phaseplot, it just doesn't work.  I do not know why.
>
> I eventually just saved each figure individual and pasted them together
> using imagemagick convert.   For the sake of argument suppose you want a
> 'quad chart' arrangement of four figures named as 1.png through 4.png.  Use
> convert to stick them together:
>
> convert +append 1.png 2.png row1.png
> convert +append 3.png 4.png row2.png
> convert -append row1.png row2.png final_image.png
>
> I'd be happy to know if there is a better way.
>
> Charles
>
>
>
>
>
> On 6/7/2011 3:52 PM, Christine Simpson wrote:
>>
>> Hi Matt,
>>
>> Do you mind if I resurrect this discussion?  I am trying to do something
>> similar, create a multiplot phase plot.  Could you say a bit more about
>> how to feed the yt phase plots to subplot()?
>>
>> Thanks
>> Christine
>>
>> On Fri, 2011-04-22 at 21:44 -0400, Matthew Turk wrote:
>>>
>>> I have replicated the error using the multi_plot.py script.  I was
>>> able to get rid of it by calling _redraw_image() on each of the plot
>>> objects...  but in general it's a bit ugly and I'm not sure that I'm
>>> entirely happy with how it works for phase plots.  You might be better
>>> suited to setting up subplot() calls directly and feeding those axes;
>>> multi_plot is mostly useful when you have multiple synchronized
>>> colorbars, which is tricky with phase plots.  Unfortunately I don't
>>> think I can backport something to make it easier to the old SVN
>>> version at this time.
>>>
>>> Best,
>>>
>>> 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