QCustomPlot Discussion and Comments

How to get y-axis coordinate?Return to overview

Hi!
I have multiple graphs in one plot, one below the other, and each with its own y-axis (they share the same x-axis).
I want to align a widget with each graph on the side. Is it possible to get the coordinate of the origin of their y-axis in relation to the top right corner of the plot?

Ok so I found another way.

The solution I found to compute the position of the 0 of the y-axis is as follow:
( axis->range().upper * this.height ) / axis->range().size()

This gives the distance between the top of the plot en the y-axis of the graph.
And this seems to work.

However, if you have a way to directly get this value without computing it yourself, I'm still interested!

Consider this: axis->coordToPixel(axis->range().upper)
that gives you the pixel of the top side of the axis.

I forgot to say it, but I already tried coordToPixel, and this gives me value ranging from -1 to 9, and I don't know why, nor what those values mean...

Have a look here:https://www.qcustomplot.com/index.php/tutorials/items
maybe that will help.