Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Conversation

@WimLeflere
Copy link

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

Add the colorblind friendly Okabe-Ito color palette.

Based on the paper: "How to make figures and presentations that are friendly to Colorblind people"
Masataka Okabe - Kei Ito (2008)
https://jfly.uni-koeln.de/color/

@oxyplot/admins

@WimLeflere
Copy link
Author

It would be nice to set this palette as the DefaultColors for PlotModel.
As the default colors (especially the first two) are quite hard to distinguish for colorblind people.

@VisualMelon
Copy link
Contributor

VisualMelon commented Oct 24, 2024

Thanks for opening this; I'll take a proper look at the weekend (ping me if I forget). We should also consider an alternative system of default styles (colours and markers and dashes etc.) to make it easier to make colorblind friendly plots (and black-and-white printable plots).

@WimLeflere
Copy link
Author

I started from this answer on StackOverflow for colorblind accessible colors in R. It has some interesting links to blogs and papers. https://stackoverflow.com/questions/57153428/r-plot-color-combinations-that-are-colorblind-accessible

Regarding the code change, should the property be renamed to OkabeIto8 to indicate the number of colors (similar to other properties)? Or should it be changed to a factory function public static OxyPalette OkabeIto(int numberOfColors)?

@VisualMelon
Copy link
Contributor

The second is probably preferable, then may or may not add one with a pre-set number of colours. The Cividis provision is a good example to follow:

public static OxyPalette Cividis(int numberOfColors = 256)

@WimLeflere
Copy link
Author

@VisualMelon have you had time to look at it?

@VisualMelon
Copy link
Contributor

Thanks for the reminder, will try to do so today.

@Jonarw
Copy link
Member

Jonarw commented Nov 12, 2024

Thanks for this PR, I think this would be a very valuable addition!

As far as I understand, the Okabe-Ito color palette is meant to visualize distinct categories, rather than continuous data. In fact, for continuous data, we do have some color palettes which are supposed to be color-blind-friendly (Viridis is the default, and we also have Cividis).

I think the peaks-based examples are more suited for continuous color palettes. For a category-based color palette like this, maybe a BarSeries-based example would be more appropriate?

I am also not sure if Okabe-Ito would be the best color palette to use as the default palette. The first color of Okabe-Ito is just plain black, which I think might not be ideal whether you are color-blind or not.
Keep in mind that I am not an expert on this topic by any means, so I could be convinced otherwise.

@VisualMelon
Copy link
Contributor

VisualMelon commented Nov 17, 2024

@Jonarw

I am also not sure if Okabe-Ito would be the best color palette to use as the default palette

Completely agree, meant to suggest something a bit more ambitious (usual thing of me dumping ideas in posts as they occur to me rather than opening a new thread): it would be nice for there to be a way to change the default colours/markers for a plot more easily, e.g. so that you can swap out the existing defaults for printer/colour-blind friendly defaults. It looks like it's actually already easy to change the DefaultColors, but PlotModel.GetDefaultLineStyle is tied to the number of default colors, and there's no automatic assignment of markers. Would be nice if it was easy to get redundant coding (as described in https://jfly.uni-koeln.de/color/ linked by @WimLeflere) without having configure individual series.

@WimLeflere does it make sense for the colours to be interpolable? If so, should probably have an API more like Cividis/BlackWhiteRed (taking a number-of-colours parmeter); if not, I think it's fine as is, but I'd agree with @Jonarw that something with different colours between series would make more sense as an example, e.g. a set of line series with the DefaultColors on the PlotModel changed to those of the palette.

@WimLeflere
Copy link
Author

I've updated the example to use line series.
Because the default line series palette (especially the first two colors) is hard to distinguish for color-blind people.

Interpolation works OK, but I prefer the default behavior of the different line types.

…orblind-friendly-palette

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants