- 积分
- 820
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-12-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近在画一些曲线图,曲线的标注想用中文,可是换出的图全是星星
begin
a=asciiread("1.txt", -1, "float");暖
b=asciiread("2.txt", -1, "float");中
c=asciiread("3.txt", -1, "float");冷
ts1=a
ts2=b
ts3=-c
ts=new((/3,64/), "float")
ts(0,:)=ts1
ts(1,:)=ts2
ts(2,:)=ts3
time=ispan(1951,2014, 1)
wks = gsn_open_wks("png","compare")
res = True ; plot mods desired
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False ; don't advance frame yet
res@vpHeightF = 0.40 ; Changes the aspect ratio
res@vpWidthF = 0.75
;res@vpXF = 0.80 ; change start locations
;res@vpYF = 0.75 ; the plot
res@xyMonoLineColor = False ; want colored lines
res@xyLineColors = (/"red","black","blue"/) ; colors chosen
res@xyLineThicknesses = (/5.,5.,5./) ; line thicknesses
res@xyDashPatterns = (/1.,0.,1./) ; make all lines solid
res@gsnYRefLine = 0 ; reference line
res@tmXBMode = "Explicit"
res@tmXBValues=(/"1951","1960","1970","1980","1990","2000","2010"/)
res@tmXBLabels=(/"1951","1960","1970","1980","1990","2000","2010"/)
res@tmXTOn="False"
res@tmYROn="False"
;res@gsnYRefLine = 0. ; reference line
res@tmYLMode="Explicit"
res@tmYLValues=(/"-2","-1","0","1","2","3"/)
res@tmYLLabels=(/"-2","-1","0","1","2","3"/)
res@tiMainString = "compare"
res@tiYAxisString = "standardize"
res@tiXAxisString = "year"
plot1=gsn_csm_xy(wks, time, ts ,res)
;*****************************************************
; Manually create and attach legend
;*****************************************************
res_text = True ; text mods desired
res_text@txFontHeightF = 0.015 ; change text size
res_text@txJust = "CenterLeft" ; text justification
res_lines = True ; polyline mods desired
res_lines@gsLineDashPattern = 1. ; solid line
res_lines@gsLineThicknessF = 5. ; line thicker
res_lines@gsLineColor = "red" ; line color
xx = (/1954,1958/)
yy = (/3.5,3.5/)
dum1 = gsn_add_polyline(wks,plot1,xx,yy,res_lines) ; add polyline
;dum2 = gsn_add_text(wks,plot1,"Extream high daily temperature frequency average",1960,3.5,res_text); add text
dum2 = gsn_add_text(wks,plot1,"区域平均",1960,3.5,res_text); add text
zz = (/2.95,2.95/)
res_lines@gsLineColor = "black" ; change to blue
res_lines@gsLineDashPattern = 0.
dum3 = gsn_add_polyline(wks,plot1,xx,zz,res_lines) ; add polyline
dum4 = gsn_add_text(wks,plot1,"Seasonal average",1960,2.95,res_text) ; add text
yy = (/2.4,2.4/)
res_lines@gsLineColor = "blue" ; change to blue
res_lines@gsLineDashPattern = 1
dum5 = gsn_add_polyline(wks,plot1,xx,yy,res_lines) ; add polyline
dum6 = gsn_add_text(wks,plot1,"Extream low daily temperature frequency average",1960,2.4,res_text) ; add text
pres = True
maximize_output(wks,pres)
end
|
-
中文是星星英文就没事
|