xy plots

From: Lucyfer (phan AT unknown)
Date: Sun Mar 17 1996 - 16:46:34 MST


Hi,

I'm running into the following problem and I was wondering if someone
might know what is causing it. I am trying to create a simple xy plot.
I am using the following lines to create my data object.

    float *xdra, *ydra;
    
    ...
    ... allocate memory and read values into xdra and ydra ...
    ...
        
        
    NhlRLClear(rlist);
    NhlRLSetFloatArray(rlist,NhlNcaXArray,xdra,NhlNumber(xdra));
    NhlRLSetFloatArray(rlist,NhlNcaYArray,ydra,NhlNumber(ydra));
    NhlCreate(&dataid,"xyData",NhlcoordArraysClass,
              NhlDEFAULT_APP,rlist);

This however fails to produce the appropriate plot. (i.e. It would only
plot the first two points and not plot the rest)

HOWEVER when I declare xdra and ydra explicitly like

        
   float xdra[10], ydra[10];

and read the 10 points into the array then the plot works
fine.

There shouldn't be a difference whether I declare it as a pointer and
then allocate the memory for it as opposed to hardwiring the size
from the begining should there?????

Any help on this issue will be greatly appreciated.

Thank You,

Lucy Phan



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:44:54 MDT