记住要举一个可重复的例子。
我得到的数据OCR在R
df <结构(列表(年= 2000:2010代码= c (129 l、129 l、129 l、129 l、129 l、129 l、129 l、129 l、129 l、129 l、129 l),价值= c(34岁的12 0 l, l, 23 l l 0 l、89 l、67 l, l (0, 0 l, l, 45 23 l)),类=“data.frame row.names = c (NA, -11 l)) # 129年代码值# 1 2000 0 # 2 2001 129 12 # 23 # 4 3 2002 129 2003 129 34 # 5 2004 129 0 # 2005 129 89 6 # 7 # 8 2006 129 67 2007 129 0 # 9 2008 129 0 45 # 11 # 2009 129 2010 129 23 p1 < - ggplot (df, aes (x =, y =值)+ geom_point() #点
df2 <- structure(list(year = 2000:2010, code = c(129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 129L, 99L, 67L, 0L, 0L, 70L, 0L)), class = "data.frame", row.names = c(NA, - 11l)) p2 <- ggplot(df2, aes(x=year, y=value)) + geom_point() # for points
库(gridExtra)库(grid)网格。安排(p1,p2, ncol=1, top=textGrob(“多个地块”,gp=gpar(fontsize=12, font = 2))))