NCAR / ADF

A unified collection of python scripts used to generate standard plots from CAM outputs.
Creative Commons Attribution 4.0 International
34 stars 29 forks source link

Add option to supply custom colormap #292

Open justin-richling opened 5 months ago

justin-richling commented 5 months ago

New feature type

New plot and/or plot enhancement

What is this new feature?

Based on the nice work from @brianpm, having access to old NCL colormap .rgb files and code to generate matplotlib colomap objects, it seems very helpful to the user if they could supply a colormap file to use in the ADF.

In addition to .rgb files, .csv files can also be an option as matplotlib can build a colormap from those files as well.

These options will live in the adf_variable_defaults.yaml file under a new variable name like colormap_file.

Assistance required?

No, I will make a PR when the feature is ready

Extra info

No response

brianpm commented 5 months ago

I like the idea of having this as a user option.

There are a bunch of conda-installable packages that have lot of good colormaps. Maybe we should consider adding one or more of those as (optional) dependencies? The poorly named colormaps (https://pratiman-91.github.io/colormaps/) has a lot. Palettable (https://jiffyclub.github.io/palettable/) also has a lot (but not the old NCL ones).