R语言gganimate学习
所需加载包
library(av)
library(ggplot2)
library(gganimate)
library(tidyverse)
library(lubridate)
library(scales)
library(ggrepel)
library(cowplot)
数据
ps = ggplot(mydatan, aes(x=reorder(省份, 累计确诊),y=累计确诊, fill=省份,frame=Date)) +
geom_bar(stat= 'identity', position = 'dodge',show.legend = FALSE) +
geom_text(aes(label=paste0(累计确诊)),col="black",hjust=-0.2)+
#theme_bw()+
#theme(legend.position="none") +
theme(axis.text.x = element_text(size = 12,angle = 90, hjust = 0.2, vjust = 0.2),legend.position="none") +
theme(panel.background=element_rect(fill='transparent'))+
theme(axis.text.y=e