Re: Error in "gsn_add_shapefile_polylines" procedure

From: Noel Aloysius <noel.aloysius_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 04 2012 - 11:15:06 MST

Hi Rick,

I was able to add the shape file with your suggestion. It works without the
last do loop - no need to call draw(maps).

Thanks,

Noel

Noel Aloysius

On Tue, Dec 4, 2012 at 12:37 PM, Rick Brownrigg <brownrig@ucar.edu> wrote:

> Hi Noel,
>
> The issue is that gsn_add_shapefile_polylines() returns an array with IDs
> for each polyline generated from a single invocation. What you really need
> is an array of length 12, where each element is an array returned from
> gsn_add_shapefile_polylines, each of which are of different sizes. To the
> best of my knowledge, that's not possible in NCL.
>
> However, I think (never done this) you might be able to use a list as the
> outer container for your 12 variably-lengthed arrays. You'd do something
> like:
>
> maps = NewList("fifo") ; or "lifo", shouldn't much matter for this
> usage
>
> and then inside your panel-loop:
>
> ListPush(maps, gsn_add_shapefile_polylines(…..))
>
>
> and then finally, rather than "draw(maps)", I think you'd have to iterate
> over the list and call draw on each element one at a time; something like:
>
> do i=1,ListCount(maps)
> draw(ListPop(maps))
> end do
>
>
> I hope that helps; let us know if not…
> Rick
>
>
> On Dec 3, 2012, at 5:16 PM, Noel Aloysius <noel.aloysius@gmail.com> wrote:
>
> > Hi NCL,
> >
> > I created a panel plot with 12 maps using "gsn_csm_contour_map_ce". I
> now want to overlay a poly-line shape file on every plot.
> >
> > I presume I will have to specify an object to hold the 12 plots after
> overlying the map with "gsn_add_shapefile_polylines". When I tried, the
> following error is thrown,
> >
> > "fatal:Dimension sizes on right hand side of assignment do not match
> dimension sizes of left hand side"
> >
> > Obviously I am not specifying the object correctly.
> >
> > I will appreciate your help.
> >
> > The script is attached.
> >
> > Thank you in advance,
> > Noel
> >
> >
> >
> <add_shape_polyline_test.ncl>_______________________________________________
> > 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 Tue Dec 4 11:15:15 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST