QCustomPlot Discussion and Comments

how to setRange(0,0.05)?Return to overview

hi, my plot step is 0.01 and i want to set the range of view between 0 and 0.5. but it doesn't work correctly when i use:

 ui->customPlot->xAxis->setRange(0,0.05);  

thanks

Is your xAxis "bind" with all your axisRect xAxis ?

If not, you'll have to change the xAxis of your axisRects:

foreach(QCPAxisRect *rect, ui->customPlot->axisRects())
    rect->axis(QCPAxis::atBottom)->setRange(0, 0.05);     

Hope this helped!

thanks, problem solved.