ui->customPlot->addGraph();
ui->customPlot->graph(0)->setPen(QPen(Qt::blue)); // line color blue for first graph
QVector<double> x(250), y(250);
for (int i=-125, j=0; i<125; i++, j++)
{
x[j] = i;
y[j] = 1.0 / (1 + pow(2.71, -i));
}
connect(ui->customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->xAxis2, SLOT(setRange(QCPRange)));
connect(ui->customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->yAxis2, SLOT(setRange(QCPRange)));
ui->customPlot->graph(0)->setData(x, y);
ui->customPlot->graph(0)->rescaleAxes();
ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
Что я делаю не так?
Сборка персонального компьютера от Artline: умный выбор для современных пользователей