2010/3/29 Alan G Isaac <alan.is...@gmail.com>:
> OK, it's obvious one you point it out.
> Sorry for the typo in the example.
>
> Now suppose I want a colorbar labelled at -1, 0, 1
> but the highest value realized is <1.  Can I somehow
> use ticks=(-1,0,1) anyway, or do I have to tick at
> the realized limits and then label "falsely".  Here's an
> example, hopefully without typos this time.
>
> x = np.linspace(-5, 5, 101)
> y = x
> Z = np.sin(x*y[:,None]).clip(-1,1-1E-6)
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
> cax = ax.imshow(Z, interpolation='nearest', extent=[-5,5,-5,5])
> cbar = fig.colorbar(cax, ticks=(-1, 0, 1))
>
> As you see, the top tick is not labelled.

On my machine, it /labels/ the +1.0, so I changed the mismatch to the
safe-failing (1 - 0.1) value, in the script attached.  Also I fixed
your problem, hopefully.

Friedrich

Attachment: norm.py
Description: Binary data

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to