0

I am wanting to create my own heat map, I am currently using the binary heat map, e.g.:

axScatter_top.hexbin(data_controlsample['log_NII_Ha'],
           data_controlsample['log_OIII_Hb'], bins='log', cmap=plt.cm.binary)

I was wondering if we were able to create our own cmaps ready for matplotlib, I would specifically like to create a heat map with the follow hex colour codes:

FF0088, FF0099, FF00AA and 660088, 660099, 6600AA

I would also like to have the distinct colour change either side of a demarcation line which is specified by:

NII   = np.linspace(-3.0, 0.35)

def log_OIII_Hb_NII(log_NII_Ha, eps=0):
     return 1.19 + eps + 0.61 / (log_NII_Ha - eps - 0.47)

axScatter_top.plot(NII, log_OIII_Hb_NII(NII), '-k') 

So essentially to the upper right of this demarcation line I would like the hex colours 660088, 660099, 6600AA and to the lower left of it I would like FF0088, FF0099, FF00AA.

GCien
  • 2,221
  • 6
  • 30
  • 56
  • You are looking define a custom colormap. See http://matplotlib.org/examples/pylab_examples/custom_cmap.html, http://stackoverflow.com/questions/16834861/create-own-colormap-using-matplotlib-and-plot-color-scale – wflynny Jul 21 '14 at 14:28
  • 1
    Hi Bill. Many thanks for your comment. I will look to study these pages over the coming days. However, it is with the added complication of creating a demarcation heat map. – GCien Jul 21 '14 at 15:38

0 Answers0