所用数据详情
Year Title Allfield
1 2001 43 405
2 2002 39 452
3 2003 50 632
4 2004 78 903
5 2005 90 1192
6 2006 119 1575
7 2007 180 1956
8 2008 171 2360
9 2009 200 2901
10 2010 210 3579
11 2011 252 4276
12 2012 238 5171
13 2013 343 6092
14 2014 349 6953
15 2015 379 8020
16 2016 452 9163
17 2017 538 10345
18 2018 574 12342
19 2019 775 15592
20 2020 796 16264
所用代码
library(readr)
library(ggplot2)
referencefigure2 <- read_csv("referencefigure2.csv") #加载数据
cut <- 20 # 考虑到次坐标轴和主坐标轴为20倍数关系
p <- ggplot(referencefigure2,aes(x=Year)) +
geom_line(aes(y=Title,colour="在标题、摘要、关键字")) +
geom_line(aes(y=Allfield/cut,colour="在所有字段")) +
scale_y_continuous(limits = c(0,800),breaks = seq(0,800,100), name = "Scopus数据库相关论文数量",sec.axis = sec_axis(~.*cut,breaks = c(seq(0,17000,3000),17000)))+
scale_x_continuous(limits = c(2001,2020),breaks=c(2001,2005,2010,2015,2020)) +
theme(legend.position = "top")
ggsave('figure1.tiff', p, width=133, height=100, units="mm") # 保存为tiff 设置大小
所得图像为