Re size the colorbar

Ive seen lots of examples around, but i cant seem to adapt any to my
implementation.
The only thing i want is to change what values the colorbar shows. In the
colorbar there are values from 1 to 1e+9, and im only interested in the
values from 1e+4 to 1e+9...

pc = ax.pcolor(pr[2].transpose(),norm=LogNorm(vmin=1),cmap=cm.jet)

ax.set_yticks(np.arange(0-(arr_agl[0]*escala)/1000,
(arr_agl[600]*escala)/1000, escala))
ax.set_yticklabels(range(20))

ax.set_ylim(0, 600)
ax.set_xlim(0,len(valores2))
ax.xaxis.LABELPAD = 18

for label in ax.get_xticklabels() + ax.get_yticklabels():
      label.set_fontsize(16)

plt.xlabel('Time of Measurement',fontsize=16)
plt.ylabel('HEIGHT above ground level, km',fontsize=16)

colorbar = fig.colorbar(pc)

Thx...

···

--
View this message in context: http://old.nabble.com/Resize-the-colorbar-tp31425316p31425316.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Ive seen lots of examples around, but i cant seem to adapt any to my
implementation.
The only thing i want is to change what values the colorbar shows. In the
colorbar there are values from 1 to 1e+9, and im only interested in the
values from 1e+4 to 1e+9...

pc = ax.pcolor(pr[2].transpose(),norm=LogNorm(vmin=1),cmap=cm.jet)

Have you tried using vmin=1e4 above?

ax.set_yticks(np.arange(0-(arr_agl[0]*escala)/1000,
(arr_agl[600]*escala)/1000, escala))
ax.set_yticklabels(range(20))

ax.set_ylim(0, 600)
ax.set_xlim(0,len(valores2))
ax.xaxis.LABELPAD = 18

for label in ax.get_xticklabels() + ax.get_yticklabels():
       label.set_fontsize(16)

plt.xlabel('Time of Measurement',fontsize=16)
plt.ylabel('HEIGHT above ground level, km',fontsize=16)

colorbar = fig.colorbar(pc)

With the suggested change to vmin, you might want to use the colorbar kwarg extend='min'.

Eric

···

On 04/18/2011 06:07 AM, Muffles wrote:

Thx...

efiring wrote:

Have you tried using vmin=1e4 above?

Well that did the trick...how did i miss that...thankyou!

···

--
View this message in context: http://old.nabble.com/Resize-the-colorbar-tp31425316p31432430.html
Sent from the matplotlib - users mailing list archive at Nabble.com.