Ouranosinc / figanos

Outils pour produire des graphiques informatifs sur les impacts des changements climatiques.
Apache License 2.0
1 stars 0 forks source link

gridmap: Invalid colormap when using cmap and levels #80

Closed Beauprel closed 1 year ago

Beauprel commented 1 year ago

Using levels should divide the colormap - even when the cmap is passed explicitely

image
sarahclaude commented 1 year ago

It works with gdfmap sp.gdfmap(df, 'OBJECTID',projection = ccrs.LambertConformal(), features = {'ocean': {'color':'#a2bdeb'}, 'borders':{'scale':'50m'}}, plot_kw = {'legend_kwds':{'orientation': 'vertical'}, 'edgecolor': 'black'}, cmap='prec_div', frame=False, levels=5 ) image

Beauprel commented 1 year ago

Actually, it works with the proper colormap filename of something_div_disc. But I think the whole idea of creating a colormap based on the number of levels (from the IPCC files) is bad. Instead I think we should get the colormap and divide it after - like we go in gdfmap.

image
sarahclaude commented 1 year ago

Est-ce que les couleurs restent les mêmes avec les splits et correspondent +/- à celles de l'IPCC?

Beauprel commented 1 year ago

After discussion, removing the IPCC discrete colormap files and implementing the way of dividing colormaps used in gdfmap and scattermap will fix this issue.

I verified that dividing the colormaps in n colors, no matter the data, produces the same n colors.

Beauprel commented 1 year ago

Closing as this is fixed by PR https://github.com/Ouranosinc/spirograph/pull/87