ggpomological
ggpomological copied to clipboard
another solution for `paint_pomological`
library(ggpomological)
basic_iris_plot <- ggplot(iris) +
aes(x = Sepal.Length, y = Sepal.Width, color = Species) +
geom_point(size = 2)
basic_iris_plot <- basic_iris_plot + scale_color_pomological()
pomological_iris <- basic_iris_plot + theme_pomological_fancy()
library(ggimage) ## `geom_image`, `geom_subview` and `theme_transparent`
ggplot(d=data.frame(x=0:1, y=0:1), aes(x, y)) +
geom_image(image=ggpomological:::pomological_images("background"),size=Inf) +
geom_subview(subview= pomological_iris+ theme_transparent(), width=Inf, height=Inf, x=.5, y=.5) +
theme_void()
The output is still gg
object.
PS: I am the author of ggimage
.
I create a shortcut in ggimage
, now we can use ggbackground
to add any background image for a gg
object.
ggbackground(pomological_iris, ggpomological:::pomological_images("background"))
oooh I like this, thanks for letting me know!
Excellent! The ggbackground function makes my life easier! One question a bit unrelated: when I save as a pdf the pomological iris, regardless of the aspect ratio, the "g" of length and the "p" of petal are cut at the border. Is this expected? Any remedy for that?