Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default color map for ospsuite plots #247

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Conversation

IndrajeetPatil
Copy link
Member

@IndrajeetPatil IndrajeetPatil commented Apr 25, 2022

As discussed in Open-Systems-Pharmacology/OSPSuite-R#894

What the palette looks like:

library(paletteer)
library(scales)

show_col(paletteer_d("ggsci::default_igv"))

Created on 2022-04-25 by the reprex package (v2.0.1.9000)

@IndrajeetPatil
Copy link
Member Author

So that, in the code below, tlf::ColorMaps$default (length = 6) will be replaced by tlf::ColorMaps$ospDefault (length = 51):

https://github.com/Open-Systems-Pharmacology/OSPSuite-R/blob/33ae4381ef76761eb9b0ef7d93ca543722d5dbec/R/default-plot-configuration.R#L163-L182

@IndrajeetPatil IndrajeetPatil requested a review from pchelle April 25, 2022 14:42
"#339900FF", "#00991AFF", "#009966FF", "#008099FF", "#003399FF",
"#1A0099FF", "#660099FF", "#990080FF", "#D60047FF", "#FF1463FF",
"#00D68FFF", "#14FFB1FF"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just out of curiosity: are those magic numbers created randomly or is there any kind of "algorithm" behind?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see the algorithm here:
https://rdrr.io/cran/ggsci/src/R/discrete-igv.R

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Following that link I found the page here with the nice overview of those colour palettes:
https://cran.r-project.org/web/packages/ggsci/vignettes/ggsci.html

Which gives some inspiration for our future extensions :)

Copy link
Member Author

@IndrajeetPatil IndrajeetPatil Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are looking for a more general overview of color palettes in R, you can see it here:
https://github.com/EmilHvitfeldt/r-color-palettes

It combines palettes from dozens of different packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. We should suggest https://github.com/aljrico/gameofthrones as our default palette to @PavelBal 😉

@Yuri05 Yuri05 merged commit 7602df3 into develop Apr 26, 2022
@Yuri05 Yuri05 deleted the osp_default_palette branch April 26, 2022 21:10
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