-
Notifications
You must be signed in to change notification settings - Fork 30
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
geom_label() sneaks past cvd_grid() #15
Comments
Thanks for pointing this out. Unfortunately, I have realized that these kinds of issues are unavoidable. There'll always be some grob that colorblindr can't properly handle. (I'm working on some right now.) Moving forward, it's probably best to just generate an image and then convert that. The colorspace package has an app that simulates color vision deficiency on images. This may be useful for you. |
Thanks for the quick note. library(tidyverse)
library(colorblindr)
#> Loading required package: colorspace
library(cowplot)
#>
#> ********************************************************
#> Note: As of version 1.0.0, cowplot does not change the
#> default ggplot2 theme anymore. To recover the previous
#> behavior, execute:
#> theme_set(theme_cowplot())
#> ********************************************************
library(grImport2)
library(grConvert)
p <- tibble(label = 'test') %>%
ggplot()+
geom_segment(aes(x = -1, xend = 1,y = 0, yend = 0, color = label))+
geom_label(aes(x=0,y=0,label = label, color = label))+
theme_void()
ggsave(plot = p,filename = '~/Desktop/p.svg',width = 2,height = 1)
grConvert::convertPicture('~/Desktop/p.svg','~/Desktop/p.c.svg')
#> '/home/khench/Schreibtisch/p.svg' (SVG) was converted to '/home/khench/Schreibtisch/p.c.svg' (Cairo SVG)
p_detour <- ggdraw(grImport2::readPicture('~/Desktop/p.c.svg') %>%
grImport2::pictureGrob(.))
cvd_grid(p_detour) Created on 2019-08-27 by the reprex package (v0.3.0) |
Please don't close the issue. It is real, and I may look into fixing it at some point. |
ups, sorry (I'm still github newbie...) |
Hello,
I just wanted to give a short heads up about a minor issue I stumbled upon:
when playing around with this great package I just realized some unexpected behaviour with when using geom_label() in combination cvd_grid() - somehow the color of this particular geom stays untouched:
Created on 2019-08-27 by the reprex package (v0.3.0)
cheers,
Kosmas
The text was updated successfully, but these errors were encountered: