- 积分
- 7953
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-12-27
- 最后登录
- 1970-1-1
|
发表于 2019-4-20 22:38:02
|
显示全部楼层
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
然后使用里面的circle_ll函数,把resc@Scale=1.0就是绘制圆了
经纬度转格点坐标可以用wrf_ll_to_ij函数
- procedure circle_ll(wks:graphic,plt:graphic,x0:numeric,y0:numeric,r:numeric,res:logical)
- ; Draws a circle (or ellipse) or radius (or x-axis length) r centered at (x0,y0). Optionally it can draw an ellipse and axes can be rotated as desired.
- ; Input Parameters:
- ; wks: graphics workstation
- ; plt: the plot graphics
- ; (x0,y0): center of the circle in terms of plot coordinate
- ; r: radius (or x-direction length) of the circle in terms of plot coordinate
- ; res: resources. If true can take any line graphic parameter valid to gsn_add_polyline. In addition, there are two special resources for this procedure:
- ; Scale: The scale by which the y-axis length should be modified to the x-axis length. This can be used to plot an ellipse. (default=1).
- ; Rotation: The rotation angle (in degrees) by which the axes are rotated (positive anticlockwhise). (default=0).
- ;
- ; Example:
- ;...
- ; arr=random_uniform(1,10,(/15,20/))
- ; wks = gsn_open_wks("x11","circle");
- ; res = True
- ; res@vpHeightF=0.5
- ; res@vpWidthF=0.8
- ; res@gsnDraw = False
- ; res@gsnFrame = False
- ; plt=gsn_csm_contour(wks,arr,res)
- ; resc=True
- ; resc@gsLineColor="red"
- ; resc@gsLineThicknessF=2
- ; resc@Scale=1.0
- ; resc@Rotation=-45
- ; circle_ll(wks,plt,10,7,3,resc)
- ; draw(plt)
- ; frame(wks)
复制代码
|
|