Hi, Believe it or not, the factor of 10000 was my only problem all the time. Until you pointed it out I never noticed that it was missing in one of the calls.
Thanks! Niko On 04/26/2010 03:26 PM, Jae-Joon Lee wrote: > I think I'm lost. > > >> In other words: the colorbar created >> by imshow should have the same values as the one created by contourf. > > But, in your original post, your plotting two different image. > with contourf, you're drawing "omega*10000", but with imshow, you're > drawing "omega". > Are you saying that these two should have same colorbar, although > there is a factor 10000 difference? > > And, as far as I know, colorbar shows values of the original input. > > What is the min and max of omega, and what do you expect your colorbar show? > If possible, please post a complete example so that others can test. > > Regards, > > -JJ > > >> >> I am not sure how I can use vmin and vmax to achieve that effect. The >> scaling is done correctly, it's just that the colorbar should show the >> original, and not the rescaled values. >> >> Thanks, >> -Niko >> >> >> I did not try vmin and vmax, because >> On 04/26/2010 02:31 PM, Jae-Joon Lee wrote: >>> Did you try to change vmin, vmax? >>> >>> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow >>> >>> If this is not what you want, please describe more explicitly why the >>> colorbar is wrong. >>> >>> Regards, >>> >>> -JJ >>> >>> >>> On Mon, Apr 26, 2010 at 11:37 AM, Nikolaus Rath <nikol...@rath.org> wrote: >>>> The problem with imshow is, that it rescales the data so the >>>> colorbar does not show the correct amplitudes (see >>>> www.rath.org/imshow.png): >>>> >>>> ctr = ax.imshow(omega, cmap=cm.YlOrRd, aspect='equal', >>>> interpolation='nearest', >>>> origin='lower', extent=(-(N-1)/2, (N-1)/2, 0, M-1)) >>>> fig.colorbar(ctr) >>>> ax.set_xlim(xmin= -(N - 1) / 2, xmax=(N - 1) / 2) >>>> ax.set_ylim(ymin=0, ymax=M - 1) >>>> fig.show() >>>> >>>> Is there a way to get the proper amplitudes into the colorbar? >> >> >> -Nikolaus >> >> -- >> »Time flies like an arrow, fruit flies like a Banana.« >> >> PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C >> -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users