Hi everyone,
I would like to create in a single graph multiple dots and each one with a different color based on a VALUE. Is there a way to do that ?
Now what i'm doing is creating new graph, each time i want this colored dot. But when i reach a "good" amount of graphs I lose performance.
...
ui->customPlot->addGraph();
ui->customPlot->graph(2 + i)->setPen(colors_.at(i));
ui->customPlot->graph(2 + i)->setLineStyle(QCPGraph::lsNone);
ui->customPlot->graph(2 + i)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, 10));
QVector<double> vec_x_temp, vec_y_temp;
vec_x_temp << traj.first.at(i);
vec_y_temp << traj.second.at(i);
ui->customPlot->graph(2 + i)->setData(vec_x_temp, vec_y_temp);
Thanks
Andrea