[ncl-talk] Box perimeter around polar projection

Adam Phillips asphilli at ucar.edu
Thu Jan 31 10:16:49 MST 2019


HI Anne,
Please include ncl-talk on all replies so others can help and see the
responses. You stated that you are still having trouble getting a box
around your polar stereographic plot. I recommended for you to use
gsn_polygon_ndc. Testing a simple example here though, it looks like
gsn_add_polygon is best used for filling a shape, while gsn_add_polyline
would be better for what you are looking to do. Here is a snippet of code
that you can use to see how best to use gsn_add_polyline to draw a box,
based off of polar stereographic example #1:

begin
  a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r")

  u = a->U(1,:,:)                                ; read July zonal winds

  wks = gsn_open_wks("png","polar")              ; send graphics to PNG file
  res            = True                          ; plot mods desired
  res at gsnFrame = False
  res at gsnPolar   = "NH"                          ; specify the hemisphere
  res at mpPerimOn = True
  plot = gsn_csm_contour_map_polar(wks,u,res)    ; create the plot

  drawNDCGrid(wks)

  x = (/0.3, 0.5, 0.5, 0.3, 0.3/)
  y = (/0.2, 0.2, 0.6, 0.6, 0.2/)
  polyres = True
  polyres at gsLineColor      = "black"
  gsn_polyline_ndc(wks, x, y, polyres)
  frame(wks)
end

If you have further questions let ncl-talk know.
Adam


On Wed, Jan 16, 2019 at 2:39 AM Anne <anne.seidenglanz at unive.it> wrote:

> Dear NCLers,
>
> I'd like to put a rectangular box perimeter around a polar projection as
> is attached as example (not plotted with NCL). I know one can set a
> perimeter with mpPerimOn=True but this will put a perimeter around the
> circular projection, not as a box. Is this possible in NCL?
>
> Any ideas welcome!
> thanks
> Anne
>
>
> Nota automatica aggiunta dal sistema di posta.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190131/6f51a592/attachment.html>


More information about the ncl-talk mailing list