library(ggplot2)
library(ggthemes)
mydata<- read.csv("D://file.csv", as.is=T)
head(mydata)
#柱子填充颜色,世界平均水平是黄色
z<-c('red','grey','grey','grey','grey','grey','grey')
ggplot(data = mydata,aes(x=Year,y=Value,group = Age,color=Age,shape=Age))+
#ggplot(data = mydata,aes(x=Year,y=Value,group = Age,shape=Age))+
geom_point()+
geom_line(size=1)+
xlab("Year")+#横坐标名称
ylab("Estimated deaths")+#纵坐标名称 from Malaria in sub-Sahara by age group
theme_bw() +#去掉背景灰色
theme(panel.grid.major=element_line(colour=NA),
panel.background = element_rect(fill = "transparent",colour = NA),
plot.background = element_rect(fill = "transparent",colour = NA),
panel.grid.minor = element_blank(),#以上theme中代码用于去除网格线且保留坐标轴边框
text = element_text(family = "STXihei"),#设置中文字体的显示
#legend.position = c(.075,.915),#更改图例的位置,放至图内部的左上角
legend.box.background = element_rect(color="black"))+#为图例田间边框线
scale_x_continuous(limits = c(2000,2019),breaks = seq(2000,2019,1))+#更改横坐标刻度值
scale_color_manual(values = c('red','grey','grey','grey','grey','grey','grey'))
#点击zoom查看大图