a bug? addata with array larger than 1024

Found a bug? Tell us about it here

Moderator: DPlotAdmin

Post Reply
ledo
Posts: 2
Joined: Fri Mar 17, 2006 3:13 am

a bug? addata with array larger than 1024

Post by ledo »

Hello, i encountered a problem when plotting an xy plot from 2 arrays with the adddata command (latest version of dplot trial & jr).

When i plot arrays of size 1024 it works, 1025 and above it fails (generic error 0).

I tried to follow the example of ctest3 which also uses adddata. I want to use addata because i'd like to plot arrays of sizes like 100000. Test3 tells me that this is the most efficient method to use.

Should I initialize dplot first? Ifso, how?
Should I use dplot_plot first? Ifso, why isn't this done in the example?

Thanks in advance for any help.


Some samplecode (used for MSVC++ 6):


dplotDocNum = dPlot_Command(0, "[FileNew()]");

int const aSize = 1025; //fails, 1024 works
double test1[aSize];
double test2[aSize];

for (int i=0; i<aSize;i++) {
test1[i]=i;
test2[i]=0;
}

DPlot_AddData8(dplotDocNum, DATA_XYXY, aSize, 0, test1, test2));
ledo
Posts: 2
Joined: Fri Mar 17, 2006 3:13 am

Solution

Post by ledo »

Hi, found the solution already,

adding:
updateDocNum(dPlot_Command(0, "[FileArrays(10,100000)"));
did the trick!
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'm glad you figured it out for yourself. If you have any more problems please let me know.
Visualize Your Data
support@dplot.com
Post Reply