Doubts, ggCyberPunk work with other kind of data? #10
Replies: 1 comment 1 reply
-
Hey @viyolopez28. First, I think this might not be possible with the current edition of ggCyperPunk. There are 2 issues that I think are happening here. I'll start with the one I'm not sure I can solve. The issue with the area is rooted in base ggplot2, since I'm referencing dplot = data.frame(x = c(2,3,4,6),y = c("day1","day2","day3","day4"),z =c( "color1","color1","color2","color2"))
dplot %>%
ggplot(
aes(x = factor(x, level = x),
y = y,
color = z,
group = 1)
) +
geom_area( size=2)+
labs(x = "Dates", y = "y")
scale_colour_manual(values=unique(z))
I get the error Issue 2 the missing lines: I think you may have an older version of the package installed. At one point I pushed a commit that had a half finished function and didn't notice till recently. I think this works with the newest version Using my latest build, I can see this plot using this code: dplot %>%
ggplot(
aes(x = factor(x, level = x),
y = y,
color = z,
group = 1)
) +
geom_glowing_line( size=2)+
labs(x = "Dates", y = "y") +
ggCyberPunk:::theme_cyberpunk()+
ggCyberPunk::scale_color_cyberpunk("cotton candy")
The area as I mentioned doesn't work with changing aesthetics in the ribbons . I think you could fake that using geom_polygon and some faked data, but I'm not sure if it's possible due to the limitations of ggplot2 |
Beta Was this translation helpful? Give feedback.
-
Hello,
Firstly, congratulations on the ggCyberPunk package, I like so much the cyberpunk style.
I have been testing with this package...but the geom_glowing_area() function looks like to not work with one group data, also R writes "error" when it is incorporate the parameter " group = 1"...
For example, I want to make this plot but with your cyberpunk style...
`dplot = data.frame(x = c(2,3,4,6),y = c("day1","day2","day3","day4"),z =c( "color1","color1","color2","color2"))
ggplot(data = dplot, aes(x = factor(x, level = x), y = y,group = 1,color = z)) +
geom_line(linetype="solid", size=2,aes(x = factor(x, level = x), y=y, color=z, group=1))+
labs(x = "Dates", y = "y") +
scale_colour_manual(values=unique(z))`
I try:
`dplot %>%
ggplot(aes(x = factor(x, level = x), y = y,color = z)) +
labs(x = "Dates", y = "y") +
geom_glowing_area(size = 2)+
theme_cyberpunk()+
scale_fill_cyberpunk("cotton candy")+
scale_color_cyberpunk("cotton candy")`
the result is a plot only with points.. and without area.
Thank you. I hope your answer to knowing if I can use this package with one group data.
PD: sorry for my English. :)
Beta Was this translation helpful? Give feedback.
All reactions