Hi,

I am trying to add a (configurable) colorbar to a an array which I simply
plot with imshow().

Could anyone please help me how to enhance it with a colorbar?

import scipy,pylab
import matplotlib.cm as cm # colormaps
import matplotlib.colors as col # colormaps

dat = scipy.array([[1,2,3,4],[5,6,7,8]])

fig = pylab.figure()
ax = pylab.gca()
ax.set_title('the title')

## here's chaos :)
#cmap = cm.get_cmap('rainbow', 20) # 10 discrete colors
#ax.imshow(dat, cmap=cmap, interpolation='nearest')
#fig.colorbar(dat)
#min,max = dat.min(),dat.max()

ax.imshow(dat,interpolation='nearest')
pylab.show()

Thanks a lot in advance,
Daniel
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to