QCustomPlot Discussion and Comments

Many plots with different own scale/fit in one plot-windowReturn to overview

Hi QCustomPlot is great,

I build a function to add a graph every time when it get call. When the function get call 10 times than i have 10 graphs in the plot-window.
Now i want to plot several graphs in the plot-window with very different values and scale. I want that every single plot get it own scale. To see the values in axis is not important (it would be too much) but all plots should have their own scale/fit into the plot-window.
Someone has an idea how this works?

the code from inside the function:

        ui->CP1->addGraph();
        ui->CP1->graph()->setData(x, y);
        ui->CP1->xAxis->setLabel("Step");
        ui->CP1->yAxis->setLabel("Value");
        ui->CP1->yAxis->scaleRange(1.1, ui->CP1->yAxis->range().center());
        ui->CP1->xAxis->scaleRange(1.1, ui->CP1->xAxis->range().center());
        ui->CP1->rescaleAxes();
        ui->CP1->replot();

Thank you very much, best regards!

In multi-axis demo there is only the possibility to make two axis (xAxis/yAxis and xAxis2/yAxis2).
Does somebody still have an idea to get more into a graph?

You can add all the axes you want to the QCPAxisRect you get from calling QCustomPlot::axisRect. When you make a new graph with QCustomPlot::addGraph, specify your custom axis.

Thank you.
I try to understand and reduce the complex plot example "Advanced Axes Demo"but the scale is set manually. Is there a possibility that every Plot get a automatic scale like rescaleAxes() just for each individual?

You can use function m_CustomPlot->rescaleAxes() for all graph.