[ncl-talk] add a circle on a plot

Dennis Shea shea at ucar.edu
Tue Jan 6 10:35:34 MST 2015


The region is so small that you can ignore the curvature of the earth and
treat it like cartesian coordinates

A simple modification of Example 4 at:
      http://www.ncl.ucar.edu/Applications/polyg.shtml

See attachment
==========================================
undef("circle")
function circle(lon0[1]:numeric, lat0[1]:numeric, rkm[1]:numeric)
begin
  R       = rkm/111.2   ; 111.2 km/degree_of_latitude;  hence   R=>degrees
  cir      = ispan(0,360,1)*0.01745329
  ncirc  = dimsizes(cir)

                       ; equations for circle
  lonc   = R*cos(cir) + lon0
  latc    = R*sin(cir)  + lat0

  lonlat = new ( (/2,ncirc/),typeof(lon0))
  lonlat(0,:) = lonc
  lonlat(1,:) = latc
  lonlat at long_name = "lon=0, lat=1 locations of circle"
  return(lonlat)
end



On Tue, Jan 6, 2015 at 2:18 AM, grace <313695096 at qq.com> wrote:

> Hi,all:
>     I am wondering how to add a circle on a plot?
>     For example,I want to indicate a round area on a drawn plot,take
> A(130°E,45°N)as the origin,40km as radius.How to add a such circle on a
> drawn plot like *gsn_add_polymarker*
>
>    Do NCL have such function?
>    Or do you guys have some advice?
>      any information will be appreciated‍
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150106/05a03e24/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grace.ncl
Type: application/octet-stream
Size: 1516 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150106/05a03e24/attachment.obj 


More information about the ncl-talk mailing list