[yt-users] Custom Colorbar Axis

Gabriel Goodwin ggoodwin52 at gmail.com
Thu Jul 16 12:10:48 PDT 2015


Hello All,

Does anyone know how to specify the tickmark locations on the colorbar
axis? I am able to do this on the plot axes without issue, but have not
been able to successfully do the same with the colorbar.

Attached is a pic of one of my plots using default colorbar axis ticks. I
have tried to use the following code (and many variants of it I have found
in the python/matplotlib documentation) to specify the location of the
tickmarks, but they don't place the ticks accurately. My data is
temperature plotted over the range of 300K to 5500K and I want to have
tickmarks at 300K, 800K, 3500K, and 4500K. Also attached is pic of my plot
showing an attempted custom colorbar axis.

I'm not sure if it makes a difference, but I made the colormap in
matplotlib.

colorbar_axes = p.plots[string].cax
colorbar_axes.yaxis.set_ticks([0, 0.1, 0.8])

Thanks for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150716/efefa4a0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cust_cax.png
Type: image/png
Size: 200634 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150716/efefa4a0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default_cax.png
Type: image/png
Size: 204833 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150716/efefa4a0/attachment-0001.png>


More information about the yt-users mailing list