Advertisement
Guest User

Untitled

a guest
May 24th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1.  
  2.   ui->customPlot->legend->setVisible(true);
  3.   ui->customPlot->legend->setFont(QFont("Helvetica", 9));
  4.  
  5.  
  6.   QPen pen;
  7.  
  8.     ui->customPlot->addGraph();
  9.     pen.setColor(QColor(Qt::black));
  10.     // generate data:
  11.     int vec_size = GaussSeidl->PointHistory.size ();
  12.     QVector<double> x(vec_size), y(vec_size);
  13.  
  14.     for (int k=0; k<vec_size; k++)
  15.     {
  16.       x[k] = GaussSeidl->PointHistory[k][0];
  17.       y[k] = GaussSeidl->PointHistory[k][1];
  18.       qDebug() << "Point History " << QString::number (GaussSeidl->PointHistory[k][0]) << " : "<< QString::number (GaussSeidl->PointHistory[k][1]);
  19.     }
  20.     ui->customPlot->graph()->setData(x, y);
  21.     ui->customPlot->graph()->setPen(pen);
  22.     ui->customPlot->graph()->setName(QCPScatterStyle::staticMetaObject.enumerator(QCPScatterStyle::staticMetaObject.indexOfEnumerator("ScatterShape")).valueToKey(QCPScatterStyle::ssDisc));
  23.     ui->customPlot->graph()->setLineStyle(QCPGraph::lsNone);
  24.     // set scatter style:
  25.     ui->customPlot->graph()->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, 10));
  26.  
  27.   // make top right axes clones of bottom left axes:
  28.   ui->customPlot->axisRect()->setupFullAxesBox();
  29.   ui->customPlot->replot ();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement