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

geom_step() behaves strangely when inverting colors #8

Open
matiasandina opened this issue Jan 5, 2023 · 0 comments
Open

geom_step() behaves strangely when inverting colors #8

matiasandina opened this issue Jan 5, 2023 · 0 comments

Comments

@matiasandina
Copy link

library(ggplot2)
library(ggdark)
set.seed(1)

df <- data.frame(x=1:100, y = rnorm(100))
ggplot(df, aes(x, y))+
  geom_point() +
  dark_theme_bw()
#> Inverted geom defaults of fill and color/colour.
#> To change them back, use invert_geom_defaults().

# This should work for both step and point
ggplot(df, aes(x))+
  geom_step(aes(y=cumsum(y), group=1))+
  geom_point(aes(y=cumsum(y)))+
  dark_theme_bw()

  
# This is the expected output, right?
ggplot(df, aes(x))+
  geom_step(aes(y=cumsum(y), group=1), color="white")+
  geom_point(aes(y=cumsum(y)))+
  dark_theme_bw()

# let's call it normally
ggplot(df, aes(x))+
  geom_step(aes(y=cumsum(y), group=1))+
  geom_point(aes(y=cumsum(y)))

invert_geom_defaults()
# now step gets inverted
ggplot(df, aes(x))+
  geom_step(aes(y=cumsum(y), group=1))+
  geom_point(aes(y=cumsum(y)))

Created on 2023-01-05 by the reprex package (v2.0.1)

@matiasandina matiasandina changed the title geom_step() behaves strange when inverting colors geom_step() behaves strangely when inverting colors Jan 5, 2023
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