[yt-users] colorbar labels

Aaron Smith asmith at astro.as.utexas.edu
Tue Nov 18 13:18:51 PST 2014


Hi Desika,

I'll just add one thing. If you want to know the min and max values of 
the colorbar you can access the matplotlib values with:

temp_plot = slc.plots['temperature']
print '(vmin, vmax) =', (temp_plot.cb.norm.vmin, temp_plot.cb.norm.vmax)

Cheers,
Aaron


On 11/18/14, 3:01 PM, Nathan Goldbaum wrote:
> Hi Desika
>
> By default, slices of the temperature field are log-scaled.  It looks 
> like there is less than one order of magnitude in temperature 
> variation, so no colorbar tick labels are showing up.
>
> You will likely have better results if you switch to linear colorbar 
> scaling:
>
> slc.set_log('temperature', False)
>
> If you switch to the latest dev version (what will be the upcoming yt 
> 3.1 release) you should have minor tick marks on your plot.
>
> Here's an example I just whipped up:
>
> http://nbviewer.ipython.org/gist/ngoldbaum/f3424a7307baeb050c61
>
> HTH,
>
> Nathan
>
>
>
>
> On Tue Nov 18 2014 at 12:42:37 PM Desika Narayanan 
> <dnarayan at haverford.edu <mailto:dnarayan at haverford.edu>> wrote:
>
>     Hi All,
>
>     I have a slice plot that I make with the simple:
>
>     slc = SlicePlot(pf,'z',('gas','temperature'))
>     slc.zoom(5)
>     slc.save('junk2.png')
>
>     and produces this (it's super ugly but not the point :) ):
>     http://i.imgur.com/j9H4imp.png
>
>     I can't figure out how to get the colorbar to reveal the numbers
>     that the colors correspond to.  Is there an obvious solution?
>
>     thanks
>     -d
>     _______________________________________________
>     yt-users mailing list
>     yt-users at lists.spacepope.org <mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141118/ef698b00/attachment.html>


More information about the yt-users mailing list