EOA-team / eodal

Earth Observation Data Analysis Library
https://eodal.readthedocs.io/en/latest/
GNU General Public License v3.0
93 stars 15 forks source link

suggestion -- ndvi colormap #38

Closed atoparseks closed 1 year ago

atoparseks commented 1 year ago

I created a custom colormap for NDVI

from  matplotlib.colors import LinearSegmentedColormap
c = [ "darkred","red","yellow", "yellowgreen" , "green","darkgreen"]
v = [0  ,          0.15  ,   0.3    ,     0.5,    0.75 ,    1]
l = list(zip(v,c))
cmap_ndvi=LinearSegmentedColormap.from_list('rg',l, N=256)

image

Would it be nice addition to the eodal library? What do you think, @lukasValentin ?

lukasValentin commented 1 year ago

Hi @atoparseks, good idea. However, keep in mind that a red-green contrast is not colorblind safe. I'd therefore recommend to use colormaps such as viridis which were designed to bypass such issues. I'm therefore not 100% sure if I'd like to make your colormap part of EOdal.

lukasValentin commented 1 year ago

In case you're not satisfied with the colormaps offered by matplotlib you might have a look at colorbrewer to design your own (color-blind safe) colorbar.

atoparseks commented 1 year ago

True, the classical NDVI isn't colourblind friendly. It's super traditional though. Thanks for brewer palettes generating link, seeing the colours on map is super helpful.