[ncl-talk] Error bars
haley at ucar.edu
Thu Jul 24 09:05:39 MDT 2014
Sorry about the delay in response. The issue is simply that you need to
make sure that when you call gsn_add_polyxxxx, the variable on the left
side of the "=" is unique every time.
Usually when you see this type of error:
warning:TransformPreDraw: tfPolyDrawList element 127 is invalid
it has to do with the variable not being unique.
You almost had it, as you defined "error_bars" and "centers" as "id"
arrays. But, these are defined inside of a larger loop across "i", and so
every time you go through another iteration of "i", the old error_bars and
centers ids were getting clobbered and reset.
One way around this is to not predefine any arrays at all, and instead just
create a dummy attribute that you can attach to "plot", and make sure this
dummy attribute has a unique name every time. Here's one way to do that:
tmp_str = "centers" + i*10 + t ; give attr a unique name
plot@$tmp_str$ = gsn_add_polymarker(wks,plot(0,0),t,pin_n(t),polyres)
tmp_str = "error_bar" + i*10 + t
On Mon, Jul 21, 2014 at 11:52 AM, Guilherme Martins <jgmsantos at gmail.com>
> Hi all,
> I'm trying to plot the error bars following the example:
> The bars are ok, but I have the error:
> fatal:Number of dimensions in parameter (0) of (NhlAddPrimitive) is (2),
> (1) dimensions were expected
> When insert the error bars.
> I'm using NCL 6.2.0. My files are in attached.
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ncl-talk