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

trr ggplot theme: hex-colors differ when entered without # #16

Open
arndtupb opened this issue Feb 19, 2022 · 0 comments
Open

trr ggplot theme: hex-colors differ when entered without # #16

arndtupb opened this issue Feb 19, 2022 · 0 comments

Comments

@arndtupb
Copy link
Member

I recognized that some of our theme-colors (i) are recognized by ggplot as color when they are entered without a # in the color option but (ii) then do not print the respective color. Reproducible example:

if (!require(ggplot2)) {install.packages("ggplot2")}   
library(ggplot2)

source("https://raw.githubusercontent.com/trr266/treat/main/code/R/theme_trr.R")

ggplot(data=data.frame(x = 0:5, y = 5)) +
  geom_hline(yintercept = 5, color = "#224B4F", linetype = "dotted") +
  geom_hline(yintercept = 4, color = "#224b4f", linetype = "dashed") +
  geom_hline(yintercept = 3, color = col_trr266_darkgreen, linetype = "longdash") +
  geom_hline(yintercept = 2, color = "224b4f", linetype = "solid") +
  ylim(1.5, 5.5) + 
  theme_trr()

The solid line at yintercept = 2 will be colored in a light grey & not in dark green as the other 3 horizontal lines. Meanwhile, ffb43b (col_trr266_yellow) throws an error Unknown colour name: ffb43b when entered without the #. Should we mark this aspect at some point in our documentation?

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

No branches or pull requests

1 participant