在图形上添加文本标注区域平均值 txres = True txres@txFontHeightF = 0.03 txres@txString = sprintf("Regional Average: %.2f", region_avg) txres@txXJust = 0.5 txres@txYJust = 0.95 txres@txPos = (/0.5, 0.95/) gsn_text_ndc(wks,txres) ; 绘制完成,关闭图形窗口 gsn_close_wks(wks) en...
Otherwise, you can setthe cnFillColors or vcLevelColors to arrays of color indices or names.Run the following script and compare the color fills in the two frames:title = This is a titleCwith a carriage returntxres = TruetxrestxFontHeightF = 0.03gsn_text_ndc(wks,title,0.5,0.5,txres)...
(wks,BlAqGrYeOrRe) res = True res@cnFillOn = True res@cnLinesOn = False res@cnLevelSpacingF = 0.5 res@gsnSpreadColors = True res@lbAutoLabelStride = True plot = gsn_csm_contour_map_ce(wks,t,res) end 二、高水平图形接口 2.1 gsn 图形接口 一般的 gsn 接口可以创建一般的 x-y 坐标,...
NCL有三个添加文本的接口:gsn_text(图形坐标)、gsn_text_ndc(页面坐标)和gsn_add_text。只有最后一个函数会将文本和图形结合在一起。例: 二十一、X-Y坐标 下面的例子使用了接口gsn_csm_xy创建一个X-Y图形: f = addfile(\“x11\True res@tiMainString = \如果你要在一副图形上画多条线,你需要将每条线...
NCL绘图示例台风路径及风圈图-大气科学学报
txres=Ngl.Resources()txres.txFontHeightF=0.012Ngl.text_ndc(wks,f.variables["t"].attributes['long_name'],0.14,0.82,txres)Ngl.text_ndc(wks,f.variables["t"].attributes['units'],0.95,0.82,txres)#--advance the frame Ngl.frame(wks)Ngl.end() ...
mkres@gsMarkerThicknessF = 1.5 ;标识的粗细 txres = True txres@txFontHeightF = 0.02 do i = 0,5 ; 绘制每个等级的图例,它由标识和文本构成 mkres@gsMarkerColor = toint(floor(ncol/nbin*(i+1)-1)) gsn_polymarker_ndc(wks,x_ndc(i),y_ndc(i),mkres) gsn_text_ndc(wks,t_ndc(i),...
nclscripts/csm/contributed.ncl ;加载ncl文件 begin wks = gsn_open_wks(“ps”,“china”) ;创建一个ps的工作空 ;间,并取名为china gsn_define_colormap(wks,WhViBlGrYeOrRe) ;为wks定义默认的colormap,在画地图的时候使用 cmap = gsn_retrieve_colormap(wks) ;为wks检索colormap 返回float类型的RGB...
“字体表”调用字符后恢复到默认字体: ~F8~m~F~ 8号字体表(希腊字母集)m号字符“μ” 28-28 18-18 1 绘制多边形polygon(面)和多边框polyline(线)的常用函数包括gsn_polygon(),gsn_polygon_ndc(),gsn_add_polygon(),gsn_polyline(),gsn_polyline_ndc(),gsn_add_polyline(),按顺序将(x,y)坐标点连接...
gsn_text_ndc 的 第一参数是从前一个对 gsn_open_wks 调用返回的工作站变量,第二个参数是要 绘制的字符串,接下来的两个参数是在 NDC 坐标中文字的 X 和 Y 的位置,最 后一个参数是一个逻辑值表明你是否设置了任何的 resources 。文本字符串将以 你指定的 X 和 Y 的位置为 围绕,除非你设置了其他的 ...