magpylib / magpylib

Python package for computation of magnetic fields of magnets, currents and moments.
https://magpylib.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
238 stars 40 forks source link

choice of color #809

Open OrtnerMichael opened 1 month ago

OrtnerMichael commented 1 month ago

Grün-Rot ist eigentlich eine sehr unglückliche Wahl der Farben da 10% der Menscheit an einer Rot-Grün Sehschwäche leidet.

The misuse of colour in science communication https://www.nature.com/articles/s41467-020-19160-7 https://www.kennethmoreland.com/color-advice/ https://www.nature.com/articles/d41586-021-02696-z https://www.ascb.org/science-news/how-to-make-scientific-figures-accessible-to-readers-with-color-blindness/

While DS 91479 will remain with RED-GREEN, we should consider what should become the magpylib default. We will not be able to abide by DINS SPEC default because there symbols will be used to annotate zones.

image

We could instead offer several named default styles e.g. to get the din-spec default style

style_color="red_green3"

or "red_blue2" or "red_blue3"

fslanovc commented 1 month ago

Please also add the corresponding colorbars to magpylib, so that the side view for instance can also be used in custom plots. For instance: magpy.cm.get_cmap("red_green3") could return a matplotlib colormap similar to e.g. mpl.cm.get_cmap("PiYG") that can return the rgb-colorcode for given parameter 0<=x<=1.