[yt-users] Multiplot Phaseplot

Matthew Turk matthewturk at gmail.com
Fri Apr 22 18:44:37 PDT 2011


Hi Charles,

On Fri, Apr 22, 2011 at 8:27 PM, Charles Hansen
<chansen at astro.berkeley.edu> wrote:
> I am trying to make a multi-plot of phase plots, but running into
> difficulty.  Phase plots seem to be different from the other plot objects I
> am used to dealing with.
>
> If I copy the cookbook version of multi_plot.py, but replace the lines like
>
> p = pc.add_slice("Density", 0, figure = fig, axes = axes[0][0],
> use_colorbar=False)
>
> with the global_phase_plots.py cookbook lines
>
> dd = pf.h.all_data()
> p = pc.add_phase_object(dd, ["Density","Temperature","x-velocity"],
> figure=fig, axes=axes[0][0], use_colorbar=False)
>
> The code immediately crashes because phase plots do not take the
> use_colorbar argument.  When I take out 'use_colorbar=False', the script
> runs, but the resulting plot is all purple (the lowest value on the default
> colorbar).  This is especially confusing because phase plots normally have
> lots of white no matter what you do with the colorbar.
>
> Does anyone know how to fix this?  For what it is worth, I am still on the
> old svn trunk (I still use Raven).

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

>
> Thanks,
> Charles
> _______________________________________________
> 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