1. Prepare Flat
suppressMessages({library(ggplot2);library(ggstar);library(cowplot);library(dplyr)})
p<- data.frame(x=.5,y=.5) %>%
ggplot(aes(x=x,y=y)) +
geom_star(starshape=15,size=80,starstroke=2,color = "firebrick",fill = NA)+
geom_star(starshape=22,size=50,starstroke=0,fill = "firebrick")+
geom_star(starshape=15,size=20,starstroke=0,fill = "gold")+
theme_minimal() + coord_equal(xlim = c(0,1),ylim = c(0,1))+
theme(panel.grid = element_blank(),axis.text = element_blank(),axis.title = element_blank(),legend.position = "none") +
ggnewscale::new_scale_fill() +
geom_star(data = expand.grid(x=seq(.25,.75,.5),y=seq(.25,.75,.5)),aes(x = x,y=y),starshape=2,size=10,starstroke=0,fill = "gold")
2. Rotating Whole Plot
animation:::saveGIF(movie.name= "Plots.gif",{
for (fp in seq(0,360,10)) { ggdraw() + draw_plot(ggplotify::as.ggplot(p,angle = fp)) + draw_label(x = .5 ,y=.5,label = "淦",color = "grey50",size = 22)->tmp;print(tmp)}
}, interval = .1, ani.width = 800, ani.height = 800)
3. Results Display
Plots.gif
网友评论