rempsyc / busara_dashboard

The Missing Majority in Behavioural Science Dashboard
https://remi-theriault.com/dashboards/missing_majority
1 stars 0 forks source link

Consider making the color palette color blind friendly #55

Closed rempsyc closed 1 week ago

rempsyc commented 1 week ago

The Communications Psychology editor comments include the following:

When choosing a color scheme please consider how it will display in black and white (if printed), and to users with color blindness. Please consider distinguishing data series using line patterns rather than colors, or using optimized color palettes such as those found at https://www.nature.com/articles/nmeth.1618. Please avoid the use of red/green color contrasts, as these may be difficult to interpret for colorblind readers.

This is also relevant given one X user's comment:

Using line patterns can be interesting in certain cases when you have few categories, but in our cases of countries (hundreds), it can be impractical. Even though we only display a max of 8 categories per figure now, 8 line types can be visually overwhelming. It would also be possible to do it only for this publication with 6 line types for the continents, but I'm not sure.

So I'd think of considering a color blind friendly palette, but not line type. WDYT @psforscher?

psforscher commented 1 week ago

i'm definitely not a fan of patterned lines. it's easy to get accidental moire effects with patterned lines https://en.wikipedia.org/wiki/Moir%C3%A9_pattern

i'd vote for using something like the viridis colorset from RColorBrewer. this has been my typical choice when making colorblind-friendly plots.

i also see that there's some nice guidance here on colorblind-friendly choices in R. i don't know the packages mentioned aside from RColorBrewer, but i'm sure there's a decent option from among the listed resources.

rempsyc commented 1 week ago

Favorite palette? These are all from the Viridis colour scales from viridisLite and integrated in ggplot2 by default

magma

image

inferno

image

plasma

image

viridis image

cividis

image

rocket

image

mako

image

turbo

image

I don't like them as much as the default theme. However, it might just be because I'm not used to them. Anyway, accessibility is more important than aesthetics. Otherwise, viridis still your favorite? I like turbo too I think.

Alternatives would include the following palettes from the colorBlindness package:

image

psforscher commented 1 week ago

i like both viridis and turbo. maybe turbo? the colors feel quite distinct with that pallette

rempsyc commented 1 week ago

In my research, I found that RColorBrewer can list its color-blind friendly palettes with display.brewer.all(colorblindFriendly = TRUE), which actually includes "set2", our current palettte... so no need to change anything!? Examples of color blind simulations with our palette:

Protanomaly image

Deuteranomaly image

Deuteranopia image

rempsyc commented 1 week ago

So our figure 1 would be:

image

rempsyc commented 1 week ago

There is an additional difficulty in that the plot looks different whether it is generated as a dynamic plotly or a static image. The website shows the interactive plotly, which we can take a screenshot of, but it is low resolution. To export to PDF (as recommended by the journal), it is only possible to export static, and so there will be differences with the website.

rempsyc commented 1 week ago

This is what Figure 2 looks like when saving directly from the plotly image export function. As I feared, it is pretty long... We could try repositioning panels to better use the space, but then it is not a "screenshot of the website" anymore and almost like "new data" I hope they're not going to be difficult about this.

newplot

rempsyc commented 1 week ago

If we want to make it like a conventional figure, then, using 4 columns to try to make it fit to the letter format, we get... But to have a perfect 4 x 4, we could remove the journals that have poor data coverage like AMPPS and Collabra.

Figure 2

psforscher commented 6 days ago

i quite like the figure you past above with four panels across. it seems though that you think there's an issue with this figure that would require us to move some journals? i think it's fine as is ...

rempsyc commented 6 days ago

I thought it would make a more optimal use of space if we got rid of the white space empty panels (I had done the same for the old figure 2), but if you’re fine with that, alright let’s keep it as is.

psforscher commented 6 days ago

i think i'm fine with it!