ansys / pymapdl-reader

Legacy binary interface to MAPDL binary files.
https://reader.docs.pyansys.com
MIT License
47 stars 23 forks source link

Make default colormap consistent with matplotlib (jet -> viridis/coolwarm) #55

Closed jgd10 closed 2 years ago

jgd10 commented 3 years ago

Several years ago matplotlib shifted from using the colormap jet as its default, which was a legacy from when it imitated MATLAB.

jet is an extremely flawed and problematic colormap that should be avoided if possible (see below for details).

Matplotlib's change was precipitated by MATLAB shifting their default to parula, a more perceptually uniform colormap, for the above reasons. MATLAB copyrighted this colormap so matplotlib couldn't use it, as such they devised their own default and made it freely available to anyone, and everyone, who wishes to use it, viridis.

Matplotlib have detailed their logic in changing away from jet and choosing viridis in a great talk I would recommend watching, which can be found here. There is also a blog post to go along with it, which can be read here.

The issue

jet is not perceptually uniform; the rate of change of data is not proportional to the rate of change of lightness of color, in fact it is quite non-linear. In addition it is not color-blind friendly. jet distorts data.

We should stop using jet as our default and shift to either viridis, (because viridis is the chosen default of matplotlib, bringing us in line with them), or to coolwarm. coolwarm should be considered because there has been research into which colormap looks best in 3D space, and divergent colormaps are generally considered superior. coolwarm is considered the best of the divergent colormaps (see here for details).

coolwarm is the default in Paraview for comparison.

Online resources

Literature

akaszynski commented 3 years ago

I don't like jet either, but it's something that Ansys loves using. I'm curious what other users want as default, but in general, I agree with your findings.

pyvista doesn't use jet as default either.

jgd10 commented 3 years ago

(closed by accident)