def cpt2cmap(filename,cmapname='colormap',lut=None,inverse=False): if not lut: import matplotlib as mpl lut = mpl.rcParams['image.lut'] cdict = cpt2python(filename) if inverse: cdict = _reverse_cmap_spec(cdict) return colors.LinearSegmentedColormap(cmapname,cdict,lut)
def cpt2cmap(filename, cmapname='colormap', lut=None, inverse=False): if not lut: import matplotlib as mpl lut = mpl.rcParams['image.lut'] cdict = cpt2python(filename) if inverse: cdict = _reverse_cmap_spec(cdict) return colors.LinearSegmentedColormap(cmapname, cdict, lut)
def _cdict_from_cpt(): import matplotlib as mpl lutsize = mpl.rcParams['image.lut'] cdict = {} for k, v in cptdic.iteritems(): cdict[k] = cpt2python(cptfldr + v) cdict[k + '_r'] = _reverse_cmap_spec(cdict[k]) return cdict
def _cdict_from_cpt(): import matplotlib as mpl lutsize = mpl.rcParams['image.lut'] cdict = {} for k,v in cptdic.iteritems(): cdict[k] = cpt2python(cptfldr+v) cdict[k+'_r'] = _reverse_cmap_spec(cdict[k]) return cdict
def _get_cm_from_pkl(filename,cmapname='colormap',lutsize=None,inverse=False): if not lutsize: import matplotlib as mpl lutsize = mpl.rcParams['image.lut'] pkl_file = open(filename, 'rb') cdict = pickle.load(pkl_file) pkl_file.close() if inverse: cdict = _reverse_cmap_spec(cdict) return colors.LinearSegmentedColormap(cmapname,cdict,lutsize)
def _get_cm_from_pkl(filename, cmapname='colormap', lutsize=None, inverse=False): if not lutsize: import matplotlib as mpl lutsize = mpl.rcParams['image.lut'] pkl_file = open(filename, 'rb') cdict = pickle.load(pkl_file) pkl_file.close() if inverse: cdict = _reverse_cmap_spec(cdict) return colors.LinearSegmentedColormap(cmapname, cdict, lutsize)
def make_pkl_file(cpt, here=None): import cPickle from matplotlib.cm import _reverser, revcmap, _reverse_cmap_spec backone = os.getcwd() + '/' + '/'.join(__file__.split('/')[:-2]) + '/' sys.path.append(backone) import cpt_tools if here is None: here = os.getcwd() + '/' + '/'.join(__file__.split('/')[:-1]) if here[-1] != '/': here += '/' cdict = {} for ent in cpt: k = ent.split('.cpt')[0] cdict[k] = cpt_tools.cpt2python(here + ent) cdict[k + '_r'] = _reverse_cmap_spec(cdict[k]) fid = open(here + 'cmaps.pkl', 'wb') cPickle.dump(cdict, fid, -1) fid.close()
def make_pkl_file(cpt,here=None): import cPickle from matplotlib.cm import _reverser, revcmap, _reverse_cmap_spec backone=os.getcwd() + '/' + '/'.join(__file__.split('/')[:-2]) + '/' sys.path.append(backone) import cpt_tools if here is None: here=os.getcwd() + '/' + '/'.join(__file__.split('/')[:-1]) if here[-1] != '/': here += '/' cdict = {} for ent in cpt: k = ent.split('.cpt')[0] cdict[k] = cpt_tools.cpt2python(here+ent) cdict[k+'_r'] = _reverse_cmap_spec(cdict[k]) fid = open(here+'cmaps.pkl','wb') cPickle.dump(cdict,fid,-1) fid.close()
def _get_color_map(): """A function to create and register the custom colour map objects in a way matplotlib can digest. The cubehelix (including Kindl et al., the Brewer3 colour maps (YlOrRd, PuBuGn, YlGnBu) all provide proper desaturation in grey-scale. """ specs = {} # We start out with the custom cubehelix maps #========= ======================================================= #Keyword Description #========= ======================================================= #gamma gamma factor to emphasise either low intensity values # (gamma < 1), or high intensity values (gamma > 1); # defaults to 1.0. #s the start color; defaults to 0.5 (i.e. purple). #r the number of r,g,b rotations in color that are made # from the start to the end of the color scheme; defaults # to -1.5 (i.e. -> B -> G -> R -> B). #h the hue parameter which controls how saturated the # colors are. If this parameter is zero then the color # scheme is purely a greyscale; defaults to 1.0. #========= ======================================================= # 0 = blue, 1 = red, 2 = green specs['cubehelix_alt'] = mpl._cm.cubehelix( h=1.5) # standard colours but more intensity specs['cubehelix_blue'] = mpl._cm.cubehelix( s=0.3, r=-0.5, h=1.5) # blue colours and higher intensity specs['cubehelix_red'] = mpl._cm.cubehelix( s=1.3, r=-0.5, h=1.5) # blue colours and higher intensity specs['cubehelix_green'] = mpl._cm.cubehelix( s=2.3, r=-0.5, h=1.5) # blue colours and higher intensity specs['cubehelix_kindl'] = mpl._cm.cubehelix( gamma=1.4, s=0.4, r=-0.8, h=2.0) # blue colours and higher intensity for name in specs: mplcm.register_cmap(name=name, data=specs[name]) mplcm.register_cmap(name=name + "_r", data=mplcm._reverse_cmap_spec(specs[name])) # #self._color_maps[name] = self.get_color_map(name) # #self._color_maps[name+"_r"] = self.get_color_map(name+"_r") return mplcm.get_cmap('cubehelix_kindl')
def make_pkl_file(cpt, here=None): import cPickle from matplotlib.cm import _reverser, revcmap, _reverse_cmap_spec backone = os.getcwd() + "/" + "/".join(__file__.split("/")[:-2]) + "/" sys.path.append(backone) import cpt_tools if here is None: here = os.getcwd() + "/" + "/".join(__file__.split("/")[:-1]) if here[-1] != "/": here += "/" cdict = {} for ent in cpt: k = ent.split(".cpt")[0] cdict[k] = cpt_tools.cpt2python(here + ent) cdict[k + "_r"] = _reverse_cmap_spec(cdict[k]) fid = open(here + "cmaps.pkl", "wb") cPickle.dump(cdict, fid, -1) fid.close()
def _get_color_map(): """A function to create and register the custom colour map objects in a way matplotlib can digest. The cubehelix (including Kindl et al., the Brewer3 colour maps (YlOrRd, PuBuGn, YlGnBu) all provide proper desaturation in grey-scale. """ specs = {} # We start out with the custom cubehelix maps #========= ======================================================= #Keyword Description #========= ======================================================= #gamma gamma factor to emphasise either low intensity values # (gamma < 1), or high intensity values (gamma > 1); # defaults to 1.0. #s the start color; defaults to 0.5 (i.e. purple). #r the number of r,g,b rotations in color that are made # from the start to the end of the color scheme; defaults # to -1.5 (i.e. -> B -> G -> R -> B). #h the hue parameter which controls how saturated the # colors are. If this parameter is zero then the color # scheme is purely a greyscale; defaults to 1.0. #========= ======================================================= # 0 = blue, 1 = red, 2 = green specs['cubehelix_alt'] = mpl._cm.cubehelix(h=1.5) # standard colours but more intensity specs['cubehelix_blue'] = mpl._cm.cubehelix(s=0.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_red'] = mpl._cm.cubehelix(s=1.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_green'] = mpl._cm.cubehelix(s=2.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_kindl'] = mpl._cm.cubehelix(gamma=1.4,s=0.4,r=-0.8,h=2.0) # blue colours and higher intensity for name in specs: mplcm.register_cmap(name=name, data=specs[name]) mplcm.register_cmap(name=name+"_r", data=mplcm._reverse_cmap_spec(specs[name])) # #self._color_maps[name] = self.get_color_map(name) # #self._color_maps[name+"_r"] = self.get_color_map(name+"_r") return mplcm.get_cmap('cubehelix_kindl')
def _register_color_maps(self): """A function to create and register the custom colour map objects in a way matplotlib can digest. The cubehelix (including Kindl et al., the Brewer3 colour maps (YlOrRd, PuBuGn, YlGnBu) all provide proper desaturation in grey-scale. """ specs = {} # We start out with the custom cubehelix maps #========= ======================================================= #Keyword Description #========= ======================================================= #gamma gamma factor to emphasise either low intensity values # (gamma < 1), or high intensity values (gamma > 1); # defaults to 1.0. #s the start color; defaults to 0.5 (i.e. purple). #r the number of r,g,b rotations in color that are made # from the start to the end of the color scheme; defaults # to -1.5 (i.e. -> B -> G -> R -> B). #h the hue parameter which controls how saturated the # colors are. If this parameter is zero then the color # scheme is purely a greyscale; defaults to 1.0. #========= ======================================================= # 0 = blue, 1 = red, 2 = green specs['cubehelix_alt'] = mpl._cm.cubehelix(h=1.5) # standard colours but more intensity specs['cubehelix_blue'] = mpl._cm.cubehelix(s=0.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_red'] = mpl._cm.cubehelix(s=1.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_green'] = mpl._cm.cubehelix(s=2.3,r=-0.5,h=1.5) # blue colours and higher intensity specs['cubehelix_kindl'] = mpl._cm.cubehelix(gamma=1.4,s=0.4,r=-0.8,h=2.0) # blue colours and higher intensity # A Python version of Matteo Niccoli's colourmaps # http://nbviewer.ipython.org/github/kwinkunks/notebooks/blob/master/Matteo_colourmaps.ipynb # ## The original data is approximated with polynomials #p0 = np.array([ -3.00669779e-36, 6.26525719e-33, -5.87240910e-30, 3.25751282e-27, -1.18087586e-24, 2.89863878e-22, -4.75604889e-20, 4.67614077e-18, -1.13599364e-16, -4.16063333e-14, 7.27326802e-12, -6.41161566e-10, 3.52560300e-08, -1.23850903e-06, 2.67527478e-05, -3.20955377e-04, 1.51205802e-03, 8.78290363e-03, 2.40494252e-02]) #p1 = np.array([ 8.13719543e-37, -1.77388587e-33, 1.75833582e-30, -1.04750030e-27, 4.17412745e-25, -1.17054612e-22, 2.36196641e-20, -3.43234035e-18, 3.50200516e-16, -2.30787699e-14, 6.79825384e-13, 3.17731005e-11, -4.59193023e-09, 2.36050767e-07, -6.49812536e-06, 9.42940406e-05, -6.24155259e-04, 4.04636648e-03, 1.11088863e-02]) #p2 = np.array([ -1.85874163e-35, 4.32740491e-32, -4.60790627e-29, 2.97271126e-26, -1.29744258e-23, 4.05138291e-21, -9.33419995e-19, 1.61295373e-16, -2.10418623e-14, 2.06972791e-12, -1.52201298e-10, 8.23377786e-09, -3.19603306e-07, 8.58912760e-06, -1.52305419e-04, 1.67708019e-03, -1.05536314e-02, 3.80789592e-02, 5.82194596e-03]) #x = range(256) #LinL = np.empty((256,3)) #LinL[:,0] = np.polyval(p0,x) #LinL[:,1] = np.polyval(p1,x) #LinL[:,2] = np.polyval(p2,x) #LinL = np.clip(LinL,0,1) LinL = np.array([[ 1.43000000e-02, 1.43000000e-02, 1.43000000e-02], [ 4.04000000e-02, 1.25000000e-02, 3.25000000e-02], [ 5.16000000e-02, 1.54000000e-02, 4.43000000e-02], [ 6.16000000e-02, 1.84000000e-02, 5.30000000e-02], [ 6.99000000e-02, 2.15000000e-02, 6.15000000e-02], [ 8.14000000e-02, 2.29000000e-02, 6.87000000e-02], [ 8.57000000e-02, 2.73000000e-02, 7.63000000e-02], [ 9.28000000e-02, 3.05000000e-02, 8.05000000e-02], [ 1.00800000e-01, 3.30000000e-02, 8.46000000e-02], [ 1.06400000e-01, 3.56000000e-02, 9.39000000e-02], [ 1.11000000e-01, 3.96000000e-02, 9.79000000e-02], [ 1.18400000e-01, 4.15000000e-02, 1.02000000e-01], [ 1.22400000e-01, 4.53000000e-02, 1.06200000e-01], [ 1.26300000e-01, 4.89000000e-02, 1.10500000e-01], [ 1.30800000e-01, 5.18000000e-02, 1.15000000e-01], [ 1.35700000e-01, 5.41000000e-02, 1.20000000e-01], [ 1.41300000e-01, 5.55000000e-02, 1.25600000e-01], [ 1.45300000e-01, 5.90000000e-02, 1.25600000e-01], [ 1.50600000e-01, 6.03000000e-02, 1.30900000e-01], [ 1.53300000e-01, 6.37000000e-02, 1.34400000e-01], [ 1.56900000e-01, 6.64000000e-02, 1.38500000e-01], [ 1.62400000e-01, 6.78000000e-02, 1.42500000e-01], [ 1.65400000e-01, 7.08000000e-02, 1.47100000e-01], [ 1.70300000e-01, 7.29000000e-02, 1.50400000e-01], [ 1.74200000e-01, 7.55000000e-02, 1.54200000e-01], [ 1.79600000e-01, 7.68000000e-02, 1.59500000e-01], [ 1.80900000e-01, 7.83000000e-02, 1.77500000e-01], [ 1.79800000e-01, 8.07000000e-02, 1.96700000e-01], [ 1.78300000e-01, 8.29000000e-02, 2.15900000e-01], [ 1.78200000e-01, 8.43000000e-02, 2.34100000e-01], [ 1.76500000e-01, 8.66000000e-02, 2.51400000e-01], [ 1.77000000e-01, 8.86000000e-02, 2.64600000e-01], [ 1.76100000e-01, 9.11000000e-02, 2.78200000e-01], [ 1.75400000e-01, 9.33000000e-02, 2.92200000e-01], [ 1.77300000e-01, 9.51000000e-02, 3.02600000e-01], [ 1.75800000e-01, 9.72000000e-02, 3.17400000e-01], [ 1.75100000e-01, 9.99000000e-02, 3.29000000e-01], [ 1.74400000e-01, 1.02500000e-01, 3.40500000e-01], [ 1.73500000e-01, 1.04700000e-01, 3.53400000e-01], [ 1.74800000e-01, 1.07100000e-01, 3.62700000e-01], [ 1.74700000e-01, 1.09400000e-01, 3.73900000e-01], [ 1.72600000e-01, 1.12200000e-01, 3.85800000e-01], [ 1.73100000e-01, 1.15300000e-01, 3.94000000e-01], [ 1.73100000e-01, 1.17500000e-01, 4.05100000e-01], [ 1.73100000e-01, 1.19700000e-01, 4.16100000e-01], [ 1.72000000e-01, 1.22400000e-01, 4.26800000e-01], [ 1.73000000e-01, 1.26100000e-01, 4.33000000e-01], [ 1.71600000e-01, 1.28500000e-01, 4.44500000e-01], [ 1.71000000e-01, 1.31400000e-01, 4.54000000e-01], [ 1.70600000e-01, 1.34000000e-01, 4.64200000e-01], [ 1.66400000e-01, 1.38100000e-01, 4.73900000e-01], [ 1.58200000e-01, 1.48200000e-01, 4.71700000e-01], [ 1.48700000e-01, 1.58300000e-01, 4.68300000e-01], [ 1.42200000e-01, 1.65300000e-01, 4.69900000e-01], [ 1.35200000e-01, 1.72900000e-01, 4.69400000e-01], [ 1.28100000e-01, 1.79600000e-01, 4.70800000e-01], [ 1.25400000e-01, 1.85400000e-01, 4.71900000e-01], [ 1.20700000e-01, 1.90400000e-01, 4.76200000e-01], [ 1.16700000e-01, 1.96200000e-01, 4.77300000e-01], [ 1.16600000e-01, 2.00400000e-01, 4.81400000e-01], [ 1.14700000e-01, 2.05700000e-01, 4.82300000e-01], [ 1.13700000e-01, 2.09300000e-01, 4.88800000e-01], [ 1.09100000e-01, 2.14900000e-01, 4.90400000e-01], [ 1.08900000e-01, 2.19000000e-01, 4.94400000e-01], [ 1.07400000e-01, 2.23400000e-01, 4.98400000e-01], [ 1.10800000e-01, 2.27000000e-01, 5.02200000e-01], [ 1.09600000e-01, 2.31500000e-01, 5.05600000e-01], [ 1.05800000e-01, 2.36700000e-01, 5.07700000e-01], [ 1.04800000e-01, 2.40200000e-01, 5.14500000e-01], [ 1.04700000e-01, 2.44400000e-01, 5.18200000e-01], [ 1.06800000e-01, 2.48200000e-01, 5.22300000e-01], [ 1.08600000e-01, 2.52100000e-01, 5.26400000e-01], [ 1.06700000e-01, 2.56800000e-01, 5.29000000e-01], [ 1.06100000e-01, 2.60700000e-01, 5.34600000e-01], [ 1.05900000e-01, 2.64800000e-01, 5.38600000e-01], [ 1.05600000e-01, 2.69000000e-01, 5.42700000e-01], [ 9.69000000e-02, 2.76900000e-01, 5.34300000e-01], [ 8.79000000e-02, 2.84700000e-01, 5.25100000e-01], [ 8.32000000e-02, 2.90700000e-01, 5.21800000e-01], [ 7.93000000e-02, 2.97200000e-01, 5.15300000e-01], [ 6.86000000e-02, 3.04400000e-01, 5.06800000e-01], [ 6.39000000e-02, 3.10600000e-01, 5.00600000e-01], [ 5.86000000e-02, 3.16600000e-01, 4.95500000e-01], [ 5.36000000e-02, 3.22700000e-01, 4.88800000e-01], [ 3.88000000e-02, 3.29200000e-01, 4.81700000e-01], [ 4.09000000e-02, 3.34300000e-01, 4.78600000e-01], [ 3.45000000e-02, 3.40100000e-01, 4.72200000e-01], [ 3.00000000e-02, 3.45800000e-01, 4.66500000e-01], [ 2.90000000e-02, 3.50600000e-01, 4.64700000e-01], [ 2.26000000e-02, 3.56400000e-01, 4.57800000e-01], [ 1.54000000e-02, 3.61900000e-01, 4.52900000e-01], [ 1.46000000e-02, 3.67000000e-01, 4.48700000e-01], [ 1.69000000e-02, 3.71800000e-01, 4.46400000e-01], [ 1.17000000e-02, 3.77300000e-01, 4.40000000e-01], [ 5.50000000e-03, 3.82800000e-01, 4.33400000e-01], [ 5.20000000e-03, 3.87300000e-01, 4.32700000e-01], [ 8.00000000e-04, 3.92700000e-01, 4.26700000e-01], [ 0.00000000e+00, 3.97700000e-01, 4.22000000e-01], [ 3.00000000e-04, 4.02400000e-01, 4.20000000e-01], [ 1.30000000e-03, 4.07200000e-01, 4.16600000e-01], [ 0.00000000e+00, 4.13200000e-01, 4.10700000e-01], [ 0.00000000e+00, 4.17900000e-01, 4.07100000e-01], [ 0.00000000e+00, 4.24200000e-01, 3.97700000e-01], [ 0.00000000e+00, 4.30200000e-01, 3.91900000e-01], [ 0.00000000e+00, 4.34500000e-01, 3.89000000e-01], [ 0.00000000e+00, 4.39500000e-01, 3.84900000e-01], [ 0.00000000e+00, 4.45600000e-01, 3.77600000e-01], [ 0.00000000e+00, 4.50800000e-01, 3.72800000e-01], [ 0.00000000e+00, 4.56300000e-01, 3.66600000e-01], [ 0.00000000e+00, 4.61300000e-01, 3.59700000e-01], [ 0.00000000e+00, 4.67000000e-01, 3.54200000e-01], [ 0.00000000e+00, 4.71600000e-01, 3.50400000e-01], [ 0.00000000e+00, 4.76300000e-01, 3.46400000e-01], [ 0.00000000e+00, 4.82000000e-01, 3.37500000e-01], [ 0.00000000e+00, 4.87000000e-01, 3.33100000e-01], [ 0.00000000e+00, 4.91800000e-01, 3.25600000e-01], [ 0.00000000e+00, 4.96900000e-01, 3.19800000e-01], [ 0.00000000e+00, 5.02400000e-01, 3.12600000e-01], [ 0.00000000e+00, 5.06000000e-01, 3.10100000e-01], [ 0.00000000e+00, 5.11800000e-01, 3.01200000e-01], [ 0.00000000e+00, 5.16600000e-01, 2.93800000e-01], [ 0.00000000e+00, 5.21400000e-01, 2.87100000e-01], [ 0.00000000e+00, 5.26800000e-01, 2.81600000e-01], [ 0.00000000e+00, 5.31500000e-01, 2.72600000e-01], [ 0.00000000e+00, 5.35600000e-01, 2.67500000e-01], [ 0.00000000e+00, 5.40700000e-01, 2.59700000e-01], [ 0.00000000e+00, 5.46100000e-01, 2.55200000e-01], [ 0.00000000e+00, 5.51900000e-01, 2.50600000e-01], [ 0.00000000e+00, 5.56500000e-01, 2.46900000e-01], [ 0.00000000e+00, 5.62400000e-01, 2.39600000e-01], [ 0.00000000e+00, 5.67800000e-01, 2.36000000e-01], [ 0.00000000e+00, 5.72700000e-01, 2.33800000e-01], [ 0.00000000e+00, 5.77800000e-01, 2.28700000e-01], [ 0.00000000e+00, 5.82900000e-01, 2.25000000e-01], [ 0.00000000e+00, 5.88300000e-01, 2.18000000e-01], [ 0.00000000e+00, 5.93100000e-01, 2.14600000e-01], [ 0.00000000e+00, 5.99100000e-01, 2.08900000e-01], [ 0.00000000e+00, 6.03600000e-01, 2.05600000e-01], [ 0.00000000e+00, 6.08400000e-01, 1.99900000e-01], [ 0.00000000e+00, 6.13800000e-01, 1.96100000e-01], [ 0.00000000e+00, 6.18900000e-01, 1.89900000e-01], [ 0.00000000e+00, 6.23900000e-01, 1.84800000e-01], [ 0.00000000e+00, 6.29000000e-01, 1.75900000e-01], [ 0.00000000e+00, 6.34500000e-01, 1.70700000e-01], [ 0.00000000e+00, 6.38100000e-01, 1.63800000e-01], [ 0.00000000e+00, 6.43800000e-01, 1.59200000e-01], [ 0.00000000e+00, 6.48900000e-01, 1.51900000e-01], [ 0.00000000e+00, 6.53600000e-01, 1.41000000e-01], [ 0.00000000e+00, 6.59000000e-01, 1.32200000e-01], [ 0.00000000e+00, 6.64500000e-01, 1.22200000e-01], [ 0.00000000e+00, 6.65600000e-01, 9.09000000e-02], [ 0.00000000e+00, 6.64400000e-01, 3.22000000e-02], [ 3.51000000e-02, 6.66000000e-01, 0.00000000e+00], [ 7.97000000e-02, 6.70300000e-01, 0.00000000e+00], [ 1.12900000e-01, 6.73900000e-01, 0.00000000e+00], [ 1.39200000e-01, 6.77600000e-01, 0.00000000e+00], [ 1.56600000e-01, 6.81400000e-01, 0.00000000e+00], [ 1.76500000e-01, 6.84700000e-01, 0.00000000e+00], [ 1.89000000e-01, 6.89000000e-01, 0.00000000e+00], [ 2.03000000e-01, 6.92800000e-01, 0.00000000e+00], [ 2.16700000e-01, 6.96600000e-01, 0.00000000e+00], [ 2.29900000e-01, 7.00300000e-01, 0.00000000e+00], [ 2.39100000e-01, 7.04400000e-01, 0.00000000e+00], [ 2.51700000e-01, 7.08100000e-01, 0.00000000e+00], [ 2.57400000e-01, 7.12400000e-01, 0.00000000e+00], [ 2.67900000e-01, 7.16200000e-01, 0.00000000e+00], [ 2.79000000e-01, 7.20000000e-01, 0.00000000e+00], [ 2.87800000e-01, 7.24000000e-01, 0.00000000e+00], [ 2.96500000e-01, 7.28000000e-01, 0.00000000e+00], [ 3.05200000e-01, 7.31900000e-01, 0.00000000e+00], [ 3.10100000e-01, 7.36200000e-01, 0.00000000e+00], [ 3.18700000e-01, 7.40200000e-01, 0.00000000e+00], [ 3.27200000e-01, 7.44100000e-01, 0.00000000e+00], [ 3.34500000e-01, 7.48200000e-01, 0.00000000e+00], [ 3.40600000e-01, 7.52300000e-01, 0.00000000e+00], [ 3.60400000e-01, 7.54900000e-01, 0.00000000e+00], [ 3.89800000e-01, 7.56300000e-01, 0.00000000e+00], [ 4.16900000e-01, 7.57400000e-01, 0.00000000e+00], [ 4.46100000e-01, 7.58000000e-01, 0.00000000e+00], [ 4.68100000e-01, 7.59400000e-01, 0.00000000e+00], [ 4.90000000e-01, 7.61200000e-01, 0.00000000e+00], [ 5.08900000e-01, 7.62700000e-01, 0.00000000e+00], [ 5.30400000e-01, 7.63700000e-01, 0.00000000e+00], [ 5.50000000e-01, 7.64900000e-01, 0.00000000e+00], [ 5.69800000e-01, 7.66000000e-01, 0.00000000e+00], [ 5.82500000e-01, 7.68800000e-01, 0.00000000e+00], [ 5.99900000e-01, 7.70100000e-01, 0.00000000e+00], [ 6.17300000e-01, 7.71300000e-01, 0.00000000e+00], [ 6.31400000e-01, 7.73000000e-01, 0.00000000e+00], [ 6.48700000e-01, 7.74100000e-01, 0.00000000e+00], [ 6.63200000e-01, 7.76300000e-01, 0.00000000e+00], [ 6.75700000e-01, 7.78200000e-01, 0.00000000e+00], [ 6.91200000e-01, 7.79500000e-01, 0.00000000e+00], [ 7.06100000e-01, 7.80800000e-01, 0.00000000e+00], [ 7.22200000e-01, 7.81800000e-01, 0.00000000e+00], [ 7.30500000e-01, 7.85200000e-01, 0.00000000e+00], [ 7.44200000e-01, 7.86600000e-01, 0.00000000e+00], [ 7.58000000e-01, 7.88000000e-01, 0.00000000e+00], [ 7.70900000e-01, 7.89600000e-01, 0.00000000e+00], [ 7.83300000e-01, 7.91500000e-01, 0.00000000e+00], [ 7.87200000e-01, 7.89100000e-01, 9.51000000e-02], [ 7.97200000e-01, 7.90300000e-01, 1.98800000e-01], [ 8.07200000e-01, 7.91700000e-01, 2.56000000e-01], [ 8.11600000e-01, 7.94900000e-01, 3.00100000e-01], [ 8.21100000e-01, 7.96400000e-01, 3.39700000e-01], [ 8.30800000e-01, 7.98000000e-01, 3.71000000e-01], [ 8.35000000e-01, 8.01100000e-01, 4.02800000e-01], [ 8.45000000e-01, 8.02600000e-01, 4.29200000e-01], [ 8.54800000e-01, 8.04100000e-01, 4.55500000e-01], [ 8.60200000e-01, 8.07300000e-01, 4.73500000e-01], [ 8.65800000e-01, 8.10000000e-01, 4.99300000e-01], [ 8.75800000e-01, 8.11600000e-01, 5.18400000e-01], [ 8.85600000e-01, 8.13000000e-01, 5.40200000e-01], [ 8.89500000e-01, 8.16400000e-01, 5.60200000e-01], [ 8.99400000e-01, 8.18000000e-01, 5.77500000e-01], [ 9.07700000e-01, 8.20200000e-01, 5.91800000e-01], [ 9.10600000e-01, 8.24100000e-01, 6.09400000e-01], [ 9.20500000e-01, 8.25700000e-01, 6.25300000e-01], [ 9.28400000e-01, 8.27800000e-01, 6.42000000e-01], [ 9.34300000e-01, 8.30700000e-01, 6.57600000e-01], [ 9.41500000e-01, 8.32900000e-01, 6.76200000e-01], [ 9.51200000e-01, 8.34800000e-01, 6.86800000e-01], [ 9.54900000e-01, 8.38400000e-01, 7.02600000e-01], [ 9.62200000e-01, 8.40800000e-01, 7.17000000e-01], [ 9.71200000e-01, 8.42900000e-01, 7.28700000e-01], [ 9.70800000e-01, 8.48200000e-01, 7.40900000e-01], [ 9.71300000e-01, 8.53000000e-01, 7.55500000e-01], [ 9.69100000e-01, 8.59100000e-01, 7.65500000e-01], [ 9.69900000e-01, 8.64200000e-01, 7.74600000e-01], [ 9.70300000e-01, 8.69100000e-01, 7.87100000e-01], [ 9.71000000e-01, 8.74000000e-01, 7.99900000e-01], [ 9.69500000e-01, 8.80000000e-01, 8.06700000e-01], [ 9.69600000e-01, 8.85100000e-01, 8.18800000e-01], [ 9.68600000e-01, 8.90800000e-01, 8.27800000e-01], [ 9.68100000e-01, 8.96200000e-01, 8.37800000e-01], [ 9.68800000e-01, 9.01300000e-01, 8.46700000e-01], [ 9.69600000e-01, 9.06400000e-01, 8.55700000e-01], [ 9.70300000e-01, 9.11500000e-01, 8.64700000e-01], [ 9.70800000e-01, 9.16300000e-01, 8.77300000e-01], [ 9.69100000e-01, 9.22400000e-01, 8.83800000e-01], [ 9.69200000e-01, 9.27300000e-01, 8.96100000e-01], [ 9.69900000e-01, 9.32300000e-01, 9.05100000e-01], [ 9.69300000e-01, 9.38100000e-01, 9.10800000e-01], [ 9.71400000e-01, 9.42500000e-01, 9.23000000e-01], [ 9.71200000e-01, 9.47800000e-01, 9.31100000e-01], [ 9.70000000e-01, 9.53700000e-01, 9.38100000e-01], [ 9.70700000e-01, 9.58700000e-01, 9.47000000e-01], [ 9.71300000e-01, 9.63800000e-01, 9.56000000e-01], [ 9.72600000e-01, 9.68700000e-01, 9.64800000e-01], [ 9.73800000e-01, 9.73800000e-01, 9.71100000e-01], [ 9.78000000e-01, 9.78000000e-01, 9.78000000e-01], [ 9.82400000e-01, 9.82400000e-01, 9.82400000e-01], [ 9.86800000e-01, 9.86800000e-01, 9.86800000e-01], [ 9.91200000e-01, 9.91200000e-01, 9.91200000e-01], [ 9.95600000e-01, 9.95600000e-01, 9.95600000e-01], [ 1.00000000e+00, 1.00000000e+00, 1.00000000e+00]]) b3 = LinL[:,2] # value of blue at sample n b2 = LinL[:,2] # value of blue at sample n b1 = np.linspace(0, 1, len(b2)) # position of sample n - ranges from 0 to 1 # Setting up columns for tuples g3 = LinL[:,1] g2 = LinL[:,1] g1 = np.linspace(0,1,len(g2)) r3 = LinL[:,0] r2 = LinL[:,0] r1 = np.linspace(0,1,len(r2)) # Creating tuples R = zip(r1,r2,r3) G = zip(g1,g2,g3) B = zip(b1,b2,b3) # Transposing RGB = zip(R,G,B) rgb = zip(*RGB) # Creating dictionary k = ['red', 'green', 'blue'] specs['matteoniccoli'] = dict(zip(k,rgb)) for name in specs: mplcm.register_cmap(name=name, data=specs[name]) mplcm.register_cmap(name=name+"_r", data=mplcm._reverse_cmap_spec(specs[name])) self._color_maps[name] = self.get_color_map(name) self._color_maps[name+"_r"] = self.get_color_map(name+"_r")