今天整理脚本的时候突然想起很久很久之前遇到的一个审稿意见,让在地图上加上比例尺和指北针。
理论上因为地图投影方式的不同,有了经纬度网格是没有必要再加指北针的,但审稿人让加也就加上了。
加的过程有点傻瓜,且不太精准,但如有需要也凑活能用吧
指北针就是画了两个实心三角形拼凑起来的,大小可能要根据自己的地图范围稍微调整一下。
比例尺是拼凑了几条线段,按照一度100km画的。
;---Add an arrow and "N" to large map 指北针
top_lat = 52
top_lon = 133
left_lat = top_lat-2
left_lon = top_lon-1
right_lat = top_lat-2
right_lon = top_lon+1
center_lat = top_lat-1.5
center_lon = top_lon
N_lat = top_lat+1
N_lon = top_lon
txres = True
txres@txFontHeightF = 0.015
txres@txFont =26
txres@txFontThicknessF = 5
txres@txFontColor = "black"
txid = gsn_add_text(wks,map,"N",N_lon,N_lat,txres)
boxlat = (/top_lat,left_lat,center_lat,right_lat,top_lat/)
boxlon = (/top_lon,left_lon,center_lon,right_lon,top_lon/)
gonres = True
gonres@gsFillColor = "black"
tlnline1 = gsn_add_polygon(wks, map, boxlon, boxlat, gonres)
;---Add an line and "比例尺" to large map
lnres = True
lnres@gsLineColor = "black"
lnres@gsLineThicknessF = 10.0
lnres@gsLineDashPattern = 0
lnline1 = gsn_add_polyline(wks, map, (/78,83/), (/20,20/), lnres)
lnline2 = gsn_add_polyline(wks, map, (/83,88/), (/20,20/), lnres)
lnline3 = gsn_add_polyline(wks, map, (/78,78/), (/20,20.5/), lnres)
lnline4 = gsn_add_polyline(wks, map, (/83,83/), (/20,20.5/), lnres)
lnline5 = gsn_add_polyline(wks, map, (/88,88/), (/20,20.5/), lnres)
lntext1 = gsn_add_text(wks, map, "0", 78, 22, txres)
lntext1 = gsn_add_text(wks, map, "500", 83, 22, txres)
lntext1 = gsn_add_text(wks, map, "1000", 88, 22, txres)
lntext1 = gsn_add_text(wks, map, "Kilometers", 83, 18.5, txres)