i have a other problem with this code :
i want to plot severals curve
for (int i=0;i<1;i++)
{
int timeNb3=0;
timeNb3=Points3_OneXtwoY[i].size();
QVector<double> x3(timeNb3);
QVector<double> y3(timeNb3);
for (int z=0;z<timeNb3;z++)
{
cout << "z " << z << endl;
cout << "i " << i << endl;
cout << "Points3_OneXtwoY " << Points3_OneXtwoY.size() << endl;
cout << "Points3_OneXtwoY[i] " << Points3_OneXtwoY[i].size() << endl;
cout << "Points3_OneXtwoY[i][z] " << Points3_OneXtwoY[i][z].size() << endl;
// x3.append( Points3_OneXtwoY[i][z][0] );
// y3.append( Points3_OneXtwoY[i][z][1] );
}
}
for (int i=0;i<1;i++)
{
int timeNb3=0;
timeNb3=Points3_OneXtwoY[i].size();
QVector<double> x3(timeNb3);
QVector<double> y3(timeNb3);
for (int z=0;z<timeNb3;z++)
{
cout << "z " << z << endl;
cout << "i " << i << endl;
cout << "Points3_OneXtwoY " << Points3_OneXtwoY.size() << endl;
cout << "Points3_OneXtwoY[i] " << Points3_OneXtwoY[i].size() << endl;
cout << "Points3_OneXtwoY[i][z] " << Points3_OneXtwoY[i][z].size() << endl;
// x3.append( Points3_OneXtwoY[i][z][0] );
// y3.append( Points3_OneXtwoY[i][z][1] );
}
}
To copy to clipboard, switch view to plain text mode
i try this code and it provide this results:
http://imageshack.us/photo/my-images/39/consoleaf.jpg/
so if i decomment the line in the previous code, it should not be error ?
=> when i run this code i have this error:
http://imageshack.us/photo/my-images/217/errorpvk.jpg/
it's strange what this code don't work because this code works nice:
int timeNb4=Points2_OneXtwoY.size();
QVector<double> x4(timeNb4);
QVector<double> y4(timeNb4);
//i fill Qvectors
for (int z=0;z<timeNb4;z++)
{
x4.append( Points2_OneXtwoY[z][0] );
y4.append( Points2_OneXtwoY[z][1] );
}
myPlot4->replot();
Total.setSamples(x4.data(),y4.data(),x4.size());
repaint();
int timeNb4=Points2_OneXtwoY.size();
QVector<double> x4(timeNb4);
QVector<double> y4(timeNb4);
//i fill Qvectors
for (int z=0;z<timeNb4;z++)
{
x4.append( Points2_OneXtwoY[z][0] );
y4.append( Points2_OneXtwoY[z][1] );
}
myPlot4->replot();
Total.setSamples(x4.data(),y4.data(),x4.size());
repaint();
To copy to clipboard, switch view to plain text mode
i have only one difference betwen this codes: the declaration of curve in the header:
QVector< QwtPlotCurve* > mycurve;
QwtPlotCurve Total;
To copy to clipboard, switch view to plain text mode
can you help me for this problem? thank you
Bookmarks