在进行文献计量作图时,我们有时需要绘制作者每年发表文章的变化。之前在公众号看到一篇关于GMT绘制的方法:https://mp.weixin.qq.com/s/N3IsZBWWraVc9Kk0KmtRfg。经过个人的琢磨,我最终实现了如下的效果。
作者每年的文献发表量
实现的代码如下:
gmtset PLOT_DEGREE_FORMAT ddd:mm:ssF
gmtset MAP_FRAME_TYPE plain
gmtset FRAM_WIDTH 0.04c
gmtset LABEL_FONT 2
gmtset LABEL_FONT_SIZE 10p
gmtset ANNOT_FONT_SIZE_PRIMARY 10p
gmtset MAP_FRAME_WIDTH 1p
gmtset MAP_ANNOT_OFFSET_PRIMARY 0.1c
set J=Cyl_stere/0/0/10c
set R=70/140/15/55
REM set J = N16c
set PS="author1.ps"
gmt makecpt -Cgray -T1000/10000/100 -I >2.cpt
gmt makecpt -Cpolar -T0/60/1 >point.cpt
gmt makecpt -Cpolar -T-2/2/0.1 >klj.cpt
psbasemap -R2009/2022/0/300 -JX15c/8c -Bxa1f5+l"year" -BS -Bya1000+l"Author" -K -X3c -Yc>%ps%
gmt psxy 1.txt -R2009/2022/0/300 -JX15c/8c -W0.5,green -X0c -Y0c -O -K>> %ps%
gmt psxy 2.txt -R2009/2022/0/300 -JX15c/8c -W0.5,yellow -X0c -Y0c -O -K>> %ps%
gmt psxy 3.txt -R2009/2022/0/300 -JX15c/8c -W0.5,purple -X0c -Y0c -O -K>> %ps%
gmt psxy 4.txt -R2009/2022/0/300 -JX15c/8c -W0.5,red -X0c -Y0c -O -K>> %ps%
gmt psxy 5.txt -R2009/2022/0/300 -JX15c/8c -W0.5,blue -X0c -Y0c -O -K>> %ps%
gmt psxy p1.txt -R2009/2022/0/300 -JX15c/8c -O -K -Sc -W0.5p,green -Ggreen -X0c -Y0c>>%ps%
gmt psxy p2.txt -R2009/2022/0/300 -JX15c/8c -O -K -Sc -W0.5p,yellow -Gyellow -X0c -Y0c>>%ps%
gmt psxy p3.txt -R2009/2022/0/300 -JX15c/8c -O -K -Sc -W0.5p,purple -Gpurple -X0c -Y0c>>%ps%
gmt psxy p4.txt -R2009/2022/0/300 -JX15c/8c -O -K -Sc -W0.5p,red -Gred -X0c -Y0c>>%ps%
gmt psxy p5.txt -R2009/2022/0/300 -JX15c/8c -O -K -Sc -W0.5p,blue -Gblue -X0c -Y0c>>%ps%
echo 2006 50 HE HS| gmt pstext -R2007/2022/0/300 -JX14c/8c -F+f10p,5,black -X0c -Y0c -N -O -K>>%PS%
echo 2006 100 LI Y| gmt pstext -R2007/2022/0/300 -JX14c/8c -F+f10p,5,black -X0c -Y0c -N -O -K>>%PS%
echo 2006 150 PENUELAS J| gmt pstext -R2007/2022/0/300 -JX14c/8c -F+f10p,5,black -X0c -Y0c -N -O -K>>%PS%
echo 2006 200 SCHELLER RM| gmt pstext -R2007/2022/0/300 -JX14c/8c -F+f10p,5,black -X0c -Y0c -N -O -K>>%PS%
echo 2006 250 WANG CJ| gmt pstext -R2007/2022/0/300 -JX14c/8c -F+f10p,5,black -X0c -Y0c -N -O -K>>%PS%
gmt psimage x.png -R%R% -J%J% -Dx0.3/8+w16c -X-1c -Y-1c -O >>%ps%
ps2raster %PS% -A -Tg -E512
作者:我是水怪的哥 https://www.bilibili.com/read/cv17950237 出处:bilibili