Hi I have the following code:
rateMap, occMap, spikeMap = pickle.load(open(rateMapFileName))
pl.imshow(rateMap)
pl.colorbar()
Now occMap is the occupancy map containing x,y position at multiple timestamps. There are some points x,y locations which have no occupancy (i.e. = 0 value at that matrix value)
When I plot rateMap(which is = spikeMap/occMap) using the script above. The colorbar that is generated uses default jetmap colormap. I want the null/0 values from occMap to appear as white in the rateMap plot. So anyway to add zero to colorbar function? and also relating it with the occMap
I tried looking at this script How to add "black" to matplotlib colormap? but couldn't get it to work?
Here is an example image which has white spots basically referring to the x,y location with 0 value or no occupancy:
*****EDIT**** I tried playing around with the code, here is how I was added white color to the colormap but I want to add this white color to default jet colormap. Any suggestions??
cmap = LinearSegmentedColormap.from_list('mycmap', ['white', 'blue', 'cyan', 'green', 'yellow','red'])
fig, ax = plt.subplots()
im = ax.imshow(im, cmap=cmap, interpolation='nearest')
fig.colorbar(im)
plt.show()