[yt-users] accessing colorbar directly

Nathan Goldbaum nathan12343 at gmail.com
Wed Sep 25 10:22:38 PDT 2013


Hi Luigi,

You can access the colobar and colorbar axes like so:

slc = SlicePlot(pf, 'x', 'Density')
plot = slc.plots['Density']
colorbar = plot.cb
colorbar_axes = plot.cax

Take a look at this notebook for an example:
http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/8bc973e0da2d4697a8e1d5a7a203d19d.ipynb

Let us know if you have any trouble getting this working for your use case.

-Nathan



On Wed, Sep 25, 2013 at 8:22 AM, Luigi Iapichino <luigi at uni-heidelberg.de>wrote:

> Dear all,
>
> I am in the process of moving most of my visualisation scripts from
> PlotCollection to the PlotWindow interface. One feature that now I am not
> able to find is the capability of customising the tick values in the
> colorbar
> of a plot. Inspired by the example script found in
>
>
> http://yt-project.org/docs/2.5/cookbook/simple_plots.html#accessing-and-modifying-plots-directly,
>
> I was thinking about interacting with a matplotlib object directly, but I
> am
> not able to find a suitable one. Could you please suggest me a workaround
> for
> this issue?
> Thanks in advance,
>
>   Luigi
>
> --
>
> ---------------------------------------------------------------
>
> Luigi Iapichino
> Universität Heidelberg, Zentrum für Astronomie
> Institut für Theoretische Astrophysik
> Philosophenweg 12, D-69120 Heidelberg, Germany
> Tel: +49 6221 548983, Fax: +49 6221 544221
> e-mail: luigi at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130925/cff3ba25/attachment.html>


More information about the yt-users mailing list