Hi all,
I have this code to plot the x^2 curve:
Code:
// add curves //set curve color // add curves curve1->attach(ui->qwtPlotWidget); const int MAX_VALUES = 100; double x[2*MAX_VALUES], y1[2*MAX_VALUES];// x and y values for (int i (-MAX_VALUES); i < MAX_VALUES; i++) { x[i] = i; y1[i] = i*i; } // copy the data into the curves curve1->setSamples(x, y1, 2*MAX_VALUES); // finally, refresh the plot ui->qwtPlotWidget->replot();
But I get this strange plot:
What's wrong?
Regards.