Hi all,
I am trying to create a custom cmap to use with the plot_grid function and I am having some trouble trying to get it to work.
I have this so far:
colors=[
(0,0,0),
(.8627,.8627, .8627),
(.5569,.4745,.7098),
(.0392,.0392, .6078),
(.2667,.9725,.8314),
(.3529,.8667,.3843),
(1,1,.3922),
(.8627,.0392,.0196),
(.6863,0,0),
(.9412, .4706,.7059),
(1,1,1),
(.5686,.1765,.5882)
]
zdr = mpl.colors.LinearSegmentedColormap.from_list('zdr',colors,12)
vmax = 8.0
zdr = mpl.colors.LinearSegmentedColormap.from_list('mycmap', [(-4 / vmax, (0,0,0)), (0 / vmax, (.8627,.8627, .8627)), (0 / vmax, (.5569,.4745,.7098)), (.25 / vmax, (.0392,.0392, .6078)),
(1 / vmax, (.2667,.9725,.8314)), (1.5 / vmax, (.3529,.8667,.3843)), (2 / vmax, (1,1,.3922)), (3 / vmax, (.8627,.0392,.0196)),
(4 / vmax, (.6863,0,0)), (5 / vmax, (.9412, .4706,.7059)), (6 / vmax, (1,1,1)), (8 / vmax, (.5686,.1765,.5882))])
But I keep getting the follow error:
ValueError: data mapping points must start with x=0. and end with x=1
I tried to follow something along the lines of this post (http://stackoverflow.com/questions/24997926/making-a-custom-colormap-using-matplotlib-in-python) but with no luck.
Any help or suggestions on an easier way to do this would be extremely helpful. Thank you!
Dustin