Re: using gsn_add_polyline in a panel plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 27 2012 - 11:49:07 MDT

Hi Erik,

Since this example uses only gsn_add_polyxxxx, and not gsn_polyxxx_ndc,
or gsn_polyxxxx, you should be able to panel the plots just fine.

The key is that anytime you call gsn_add_polyxxxx, you need to make sure the
variable on the left side of the "=" is always unique. If you don't do this, then
only the last polylines that you add will be visible.

So, using the example you pointed to, and assuming you already have
an array of plots that you want to panel, you would do something like this
to add the lines:

; create array of dummy graphic variables. This is required, b/c each line
; must be associated with a unique dummy variable.

  dum = new((/nplots,4/),graphic)

; draw each line separately. Each line must contain two points.
  do n=0,nplots-1
    do i = 0 , 3
      dum(n,i)=gsn_add_polyline(wks,plot(n),xpts(i:i+1),ypts(i:i+1),resp)
    end do
  end do
. . .

  dum_gons = new((/nplots,3/),graphic)
  do n=0,nplots-1
    dum_gons(n,0) = gsn_add_polygon(wks,plot(n),xtri,ytri,resp)
     . . .
    dum_gons(n,1) = gsn_add_polygon(wks,plot(n),xtri+10,ytri,resp)
    . . .
    dum_gons(n,2) = gsn_add_polygon(wks,plot(n),xtri+20,ytri,resp)

  end do

  gsn_panel(wks,plot,...)

On Jun 27, 2012, at 11:30 AM, Erik N wrote:

> Hi, how could this example on the NCL Examples be used in a panel plot?
>
> Example 4 , polylines page
> http://www.ncl.ucar.edu/Applications/polyg.shtml
> http://www.ncl.ucar.edu/Applications/Scripts/polyg_4.ncl
>
>
> --
> - Erik -
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 27 11:49:31 2012

This archive was generated by hypermail 2.1.8 : Fri Jun 29 2012 - 15:46:14 MDT