- 积分
- 128
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-3-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 Lllllin 于 2023-6-17 19:53 编辑
如题,画的是XY折线图,有三根折线,程序没有warning,但图例出现重叠的情况。画图例的程序如下,请各位大佬帮忙看看是哪里出问题了!!!
res@xyMonoLineColor = False ; want colored lines
res@xyLineColors = (/"Blue","darkgreen","Red"/) ; colors chosen
res@xyLineThicknesses = (/7.,7.,7./) ; line thicknesses
res@xyDashPatterns = (/0.,0.,0./) ; make all lines solid
res@gsnLeftString = "SU35" ;标记是什么图
res@gsnRightString = "d" ; ~F35~J~F~C ℃
res@gsnLeftStringFontHeightF = 0.02
res@gsnRightStringFontHeightF = 0.02
;---图例
labels = (/"SSP1-2.6","SSP2-4.5","SSP5-8.5"/)
res@pmLegendDisplayMode = "Always"
res@pmLegendWidthF = 0.2
res@pmLegendHeightF = 0.08
res@pmLegendOrthogonalPosF = -1.1
res@pmLegendParallelPosF = 0.15
res@xyExplicitLegendLabels = labels
res@lgLabelFontHeightF = 0.015
res@lgBoxMinorExtentF = 0.3
res@lgItemOrder = (/2,1,0/)
res@lgPerimOn = False
top_plot = gsn_csm_xy (wks,Y,line_ydata(0:2,:),res) ; create line plot
------------------------------------------------------------------------------------------------
后面一段是加阴影部分的,不知道有没有影响所以我也放上来了
------------------------------------------------------------------------------------------------
; Create a plot with the area between both curves filled in blue.
delete(res@xyLineColors)
delete(res@lgItemOrder)
; Create a plot with the area between both curves filled in color.
res@gsnXYFillColors = "LightBlue"
res@xyLineColor = -1 ; We don't want the line, so make it transparent.
mid1_plot = gsn_csm_xy (wks,Y,line_ydata(3:4,:),res) ; Create filled XY plot.
res@gsnXYFillColors = "darkseagreen2"
res@xyLineColor = -1 ; We don't want the line, so make it transparent.
mid2_plot = gsn_csm_xy (wks,Y,line_ydata(5:6,:),res) ; Create another filled XY plot.
res@gsnXYFillColors = "LightPink"
res@xyLineColor = -1 ; We don't want the line, so make it transparent.
bot_plot = gsn_csm_xy (wks,Y,line_ydata(7:8,:),res) ; Create another filled XY plot.
;
; Overlay the top and mid plots on the bottom plot.
;
; Don't draw anything yet, because we still need to
; attach a legend and some titles.
;
overlay(bot_plot,mid2_plot)
overlay(bot_plot,mid1_plot)
overlay(bot_plot,top_plot)
pres = True
maximize_output(wks,pres)
print("---already print plot---")
-----------------------------------------------------------------------------------
|
-
SU35
|