python - Change color limits with quiver in matplotlib? -
how should syntaxis changing limits of color range when plotting quivers in matplotlib? have following code:
pyplot.ion() xlim(1, 64) ylim(1, 64) flechitas = quiver(x, y, efx, efy, sqrt((efx.*efx+efy.*efy)), pivot="middle", cmap="blues") cb=colorbar(flechitas) which produces adecuate image uses automatically detected range 5th argument (the color). in manual of matplotlib says can use clim keyword if put inside arguments or outside, after xy limits, error indicating must create image first, imageshow. if that, more obscure error, assertionerror(). matplotlib 1.3.1.
okey, got it, right way matplotlib 1.3.1
figure() xlim(1,64) ylim(1,64) flechitas=quiver(x,y,efx,efy, sqrt((efx.*efx+efy.*efy)), units="x", pivot="middle", cmap="blues", width=0.4); cb=colorbar(flechitas, clim(0,120)); so, clim(min, max) must argument colorbar(...), seems.
Comments
Post a Comment