scicomap icon indicating copy to clipboard operation
scicomap copied to clipboard

Some colormaps aren't reversed

Open endolith opened this issue 1 year ago • 1 comments

I'm confused as to why amber and amber_r both exist, for instance, but deep_r does not exist. I also don't see a function to reverse a colormap or anything like that? I guess I can use map.get_mpl_color_map().reversed().

endolith avatar Aug 09 '24 01:08 endolith

Hello @endolith, thank you for reaching out.

I primarily rely on established colormap providers and do not create my own, including reversed colormaps. While some colormaps benefit from reversal, others may not. Reversed sequential colormaps often work well with dark backgrounds.

You can indeed use the reversed() method in Matplotlib to reverse existing (list) colormaps.

If you'd like me to incorporate additional colormaps from reputable sources, please feel free to suggest them. I'll evaluate whether they warrant inclusion or if adding a dependency is necessary.

However, the standardization functions should work fine with your own, you can pass a mpl cmap as in the example:

import scicomap as sc
import matplotlib.pyplot as plt

# works for other cmap type
mpl_cmap = plt.get_cmap(A_MPL_SEQUENTIQL_CMAP)
sc_map =  sc.ScicoSequential(cmap=mpl_cmap)
f=sc_map.assess_cmap(figsize=(22,10))

ThomasBury avatar Aug 09 '24 05:08 ThomasBury