0

I have a file GMT_panoply.rgb with the following color table:

ncolors= 16
# r g b
0.015686 0.054902 0.847059
0.125490 0.313725 1.000000
0.254902 0.588235 1.000000
0.427451 0.756863 1.000000
0.525490 0.850980 1.000000
0.611765 0.933333 1.000000
0.686275 0.960784 1.000000
0.807843 1.000000 1.000000
1.000000 0.996078 0.278431
1.000000 0.921569 0.000000
1.000000 0.768627 0.000000
1.000000 0.564706 0.000000
1.000000 0.282353 0.000000
1.000000 0.000000 0.000000
0.835294 0.000000 0.000000
0.619608 0.000000 0.000000

When I use python Basemap for plotting, I generally do the following:

ax.map.pcolor(x,y,np.squeeze(val), cmap='jet')

How to do this plotting by replacing jet with the file GMT_panoply.rgb that has my color table?

ASE
  • 1,702
  • 2
  • 21
  • 29
  • Perhaps this previous [question](https://stackoverflow.com/questions/16834861/create-own-colormap-using-matplotlib-and-plot-color-scale) may contain helpful information. – Jacob K Dec 19 '20 at 23:13

1 Answers1

1

In case Jacob K's answer is not sufficient, my CMasher package allows one to import their own colormaps into Python with a single function (https://cmasher.readthedocs.io/user/usage.html#custom-colormaps).

1313e
  • 1,112
  • 9
  • 17