1313e / CMasher

Scientific colormaps for making accessible, informative and 'cmashing' plots
https://cmasher.readthedocs.io
BSD 3-Clause "New" or "Revised" License
427 stars 29 forks source link

Diverging white-centered colormaps with #34

Closed kgrasha closed 3 years ago

kgrasha commented 3 years ago

Describe the colors you would like I am currently using the cosmic and the gothic sequential colormaps and I love these colors (especially that really nice bright blue in cosmic) and for uniformity in the plots, I'm not super happy with current blue and purple diverging colormaps for subsequent plots when showing distributions from the mean. Two diverging colormaps with white centres (one blue-brown/red/oorange and the second purple-brown/red.orange), which I envision would be similar to: 1 - cosmic and sunburst (that bright blue to a browny/red/orange color, white centre) 2 - amethyst and sunburst (a purple to a browny/red/orange color, white centre).

Describe the colormap type diverging

Describe any extra properties Colour-blindness and black/white friendly would be great.

Is your colormap request related to a specific application? Please describe. I'm making metallicity maps (which are coloured with the cosmic sequential maps) and ionisation parameter maps (coloured with the gothic colormap) of galaxies. I fit radial profile distribution with a linear fit and then subtract off the fit to study the scatter around the average value, and these plots are best representative with diverging maps. Matplotlib's PuOr is too dark of purples compared to the cmr.gothic purple (which is really nice by the way!), and the same goes for blue diverging color bars, I wish there was one with the nice bright blue that makes cmr.cosmic so great.

Additional context I do realise it is more complicated than taking two color bars and stitching them together to make a diverging colorer.

1313e commented 3 years ago

Hi @kgrasha, thanks for your request and it is great to see that you like the colormaps that CMasher has to offer. I have quite a long answer to your request, so bear with me please.

So, if I understand correctly, what you are looking for is the following:

  1. Bright blue - red/orange white-centered diverging colormap (cosmic/sunburst);
  2. Purple - red/orange white-centered diverging colormap (amethyst/sunburst. Are you sure you meant amethyst and not gothic?).

These colormaps are then used for studying how close the scattered values are to the average value, as white-centered diverging colormaps should be used for plots where the importance of the values decreases with increasing distance to the center, and black-centered ones for those plots where the importance increases with increasing distance to the center. Did I get all that right?

If so, then I am also assuming that the fusion colormap is not what you are looking for, which is blue/purple - red/orange, has a white center and is relatively close to the combination of amethyst and sunburst (they are not related to each other, unlike flamingo and redshift for example). I can show this by literally combining the amethyst and sunburst colormaps together and comparing it to fusion: amethyst_sunburst fusion_viscm They of course aren't quite the same, but it gets rather close. If you are however happy with something like this, then I can just give you the files that contain the colormap data (as it is too similar to fusion for me to add to CMasher really).

For the first colormap (blue - white - red/orange), it would probably be something similar to iceburn, but with a white center instead of a black one. I actually currently have a concept colormap in the works that is pretty much that (after a friend asked me for it), albeit slightly less dark around the edges, which currently looks like this: prinsenvlag This might however be too much orange and not enough red. Let me know what you think of this.

Then I get to the use of cosmic. The thing that makes cosmic so great is that it does not go from pure black to pure white (or, as I would call it, a [0, 100] colormap), but instead goes from pure black to something else. The point of not using white as the final color is that it unlocks a very large range of colors that can be in the colormap that are too far away from white to be used in a colormap that does end in white (given the requirement that the colormap must be perceptually uniform sequential). All colormaps in the CMasher colormap overview on the docs and README that are above amethyst do not end in white, but instead end in such a color (that cannot be reached otherwise).

Basically, what this means, is that the bright blue at the end of cosmic is a color that cannot be reached from white. The distance between white and that blue is too large. To illustrate this, this is what cosmic would look like if I made it end in pure white: cosmic This is rather close to a hybrid of freeze and voltage and really does not have that nice bright blue part in it anymore. Of course, using cosmic as the end of a black-centered diverging colormap can be done, as it has a black end, but that is not what you were requesting.

Let me know what you think about my comments above and how to proceed. I am more than happy to give it a try to include as much of cosmic in a white-centered diverging colormap as possible, but I have no idea how that will turn out.

kgrasha commented 3 years ago

The more I think about it, fusion and a white-centered iceburn would be completely appropriate for what I'm looking for. I hear what you are saying regarding cosmic, and while I love it, having it go from white simply cannot be achieved. Who would have thought that I should have just asked for a white-centered iceburn!

1313e commented 3 years ago

Haha. That is why I gave a detailed and extensive answer, to show you the possibilities. Would you like the white-centered iceburn to be rather dark near the edges or just bright like the prinsenvlag concept above?

kgrasha commented 3 years ago

Bright like the prinsenvlag concept above is great!

kgrasha commented 3 years ago

thank you!

1313e commented 3 years ago

Alright, I am hoping to tackle all these open issues tomorrow. Tomorrow is going to be a very colorful day it seems. :)

1313e commented 3 years ago

Alright, the prinsenvlag colormap was added in 812f6d3. I am waiting for responses in other issues before v1.6.1 on the dev branch will be released. If you really need the colormap right now, you can download this file from the dev branch and load the colormap into MPL that way.

1313e commented 3 years ago

Can I consider this issue to be resolved, @kgrasha?

kgrasha commented 3 years ago

Yes