distinguishable matplotlib colours / symbols / line styles
DL Neil
PythonList at DancesWithMice.info
Mon Dec 16 16:08:09 EST 2019
On 17/12/19 5:19 am, Chris Angelico wrote:
> On Tue, Dec 17, 2019 at 3:16 AM duncan smith <duncan at invalid.invalid> wrote:
>>
>> Hello,
>> Not really specific to Python or matplotlib (but that's what I'm
>> using). I'm looking for a good combination of colours and symbols for
>> scatter plots, and combination of colours and line styles for line
>> plots. Too often I find myself producing these when I don't know whether
>> they will end up being printed in colour or greyscale. It would be a lot
>> easier if I could produce decent plots that would work well in either
>> case. I can find various stuff on colour palettes, but pretty much
>> nothing on symbols or line styles. Is anybody aware of an approach that
>> works well? I'm aware of issues with colour blindness and RGB versus
>> CMYK. Ideally I'd have something that I could just use that would deal
>> with all these issues. TIA.
>>
>
> I'd recommend looking at the Web Content Accessibility Guidelines
> published by the W3C; there are a number of tools out there that are
> designed to help you pick colours for a web page, and the same sorts
> of rules will apply here, I think.
>
> Also, thank you for even *thinking* about this. A lot of people don't. :)
+1
We spend a lot of time teaching this topic (non-Python courses). It
receives a lot of often highly-polarised comments/discussion. Many folk
have their 'eyes opened' to an issue which has not affected them
personally. Some even have to be informed that it is a legal obligation
in their jurisdiction. However, it also receives the highest number of
'why do I have to learn this stuff' complaints...
I learned (way back) that the incidence of "color blindness" is far
higher than I had imagined. Secondly, that it affects males more than
females. Thirdly, that calling it "blindness" is a bit of a misnomer,
because whilst people often can't see red 'correctly' (most common
symptom), they do see something (it varies). Which is why they are
permitted to drive vehicles (traffic lights: red, amber/yellow, green -
and arrows; plus stop/brake lights), but why many smart-phone apps/web
pages which encode information-relevance (red is 'wrong' and green/blue
is acceptable) can become almost unusable (without other cues).
Those key-words: "accessibility guidelines" will yield a swag of useful
tools - ignore the ones which are basically 'help choose the color of my
web page/color palette, because they are often aiming (only) for
'pretty'. The best tools enumerate the efficacy of fg/bg
color-combinations, allowing one to experiment; and will enumerate
grey-scale variation/comparisons.
Hmmm, note to self (you've inspired me to specifically review/critique
the printing-from-screen action): what happens when we take a
color-checked screen display and print same but end-up viewing it as
monochrome/grey-scale output? Probably not a main-stream demand, but
worth tossing at the WCAG experts...
--
--
Regards =dn
More information about the Python-list
mailing list