QCustomPlot Discussion and Comments

Y-Axis value scalingReturn to overview

Hi guys,

Currently, i'm trying to implement different axis at the left side of the plotter. The Problem is that i have several curves with large differences, e.g. curve 1 has range from 0..5 but curve 2 has a y-range from 0..8000, so when i Display both curves with a scaling of 1, i can't see the differences of curve 1 easily.

So, my question is, is there an easy way to scale curves and Display them on a own y-axis where the non scaled values are Display, e.g. for curve 1 with values from 0..5 on the new y-axis!??

You have two possibilities:
1. You could use a logarithmic axis scaling. This way both large and small data sets can be viewed with a single axis. See QCPAxis::setScaleType.

2. You could use separate y axes for the data sets. For example, QCustomPlot by default has two y axes (yAxis on the left and yAxis2 on the right). You just need to make it visible via customPlot->yAxis->setVisible(true), and assign the yAxis2 as "value axis" to your graph (e.g. in the constructor of the QCPGraph, or in addGraph()).
Of course you could also add a second y axis on the left of the axis rect. To find out how to do that, have a look at the "advanced axes demo" in the examples project.