[yt-users] how to make a SlicePlot colorbar use mathtext?

Chris Malone chris.m.malone at gmail.com
Wed Aug 20 08:33:31 PDT 2014


Hey Mike,

I'm not sure if this is the issue or not, but after you apply your
formatter to the colorbar, you need to call cbar.update_ticks() for them to
actually change.

Chris


On Wed, Aug 20, 2014 at 9:12 AM, Michael Zingale <
michael.zingale at stonybrook.edu> wrote:

> Does anyone know how to make a SlicePlot colorbar from yt use mathtext in
> the tick labels?  I am doing the following in a loop over x, y, z planes:
>
>
>         p = yt.SlicePlot(ds, d, var, center=(center[0], center[1],
> center[2]),
>                          origin="native", fontsize=10)
>         p.set_log(var, log)
>
>         plot = p.plots[var]
>         plot.figure = fig
>         plot.axes = grid[i].axes
>         plot.cax = grid.cbar_axes[i]
>
> I can get at the colorbar object via cb = plot.cb, but I can't seem to
> turn on mathtext.  I can modify the axes to use my formatter so they look
> pretty, but I've tried to set a colorbar formatter with no success.
>
> Here's my image:
>
> http://bender.astro.sunysb.edu/random/test.png
>
> Notice that the offset text for the colorbar is "1.e6" instead of in latex
> (I still have to remove the offset text for the two rightmost y-axes later,
> but I know how to do that).
>
> Mike
>
> --
> Michael Zingale
> Associate Professor
>
> Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
> 11794-3800
> *phone*:  631-632-8225
> *e-mail*: Michael.Zingale at stonybrook.edu
> *web*: http://www.astro.sunysb.edu/mzingale
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140820/b19b6fa3/attachment.htm>
-------------- next part --------------
_______________________________________________
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