QCustomPlot Discussion and Comments

Millisecond X AxisReturn to overview

Hi, I am using a millisecond format_time for the X axis but the step displayed is 0.5s.

How could I setup a step of 1 millisecond for this X Axis ?

Here is the code used:


    QSharedPointer<QCPAxisTickerTime> format_time(new QCPAxisTickerTime);
    format_time->setTimeFormat("%m:%s:%z");
    plot0->xAxis->setTicker(format_time);

You can use QCPAxisTickerDateTime.

QSharedPointer<QCPAxisTickerDateTime> dateTimeTicker(new QCPAxisTickerDateTime);
dateTimeTicker->setDateTimeSpec(Qt::UTC);
dateTimeTicker->setDateTimeFormat("mm:ss:zzz");
ui->plot->xAxis->setTicker(dateTimeTicker);

Hi Erman,

I tried your solution but unfortunately it dis not solved my problem
the step between two Xaxis labels is still 2.5s and therfore the step is 0.5s and not 1 millisecond