PDA

View Full Version : generating graph with unequal intervals using QCustomPlot in Qt



Navi
4th June 2015, 13:07
I am able to generate the graph with equal intervals on both the axis using QCustomPlot .But i need to generate dynamically with unequal intervals.

How can we generate graph with unequal intervals in x and y axis using QCustomPlot.

d_stranz
6th June 2015, 17:32
QCustomPlot is not part of Qt, it is an external library. I suggest you go to the QCustomPlot forum (http://qcustomplot.com/index.php/support/forum) and ask there.

Edit - which I see you did, so never mind. You probably want this:


void QCPAxis::setTickVector ( const QVector< double > & vec )

If you want full control over what ticks (and possibly labels) the axes show, this function is used to set the coordinates at which ticks will appear. setAutoTicks must be disabled, else the provided tick vector will be overwritten with automatically generated tick coordinates upon replot. The labels of the ticks can be generated automatically when setAutoTickLabels is left enabled. If it is disabled, you can set the labels manually with setTickVectorLabels.

vec is a vector containing the positions of the ticks, in plot coordinates.

ChrisW67
7th June 2015, 09:21
See the code snippet for the Bar Chart Demo on the QCustomPlot (http://qcustomplot.com/index.php/introduction) front page.