QCustomPlot Discussion and Comments

How to move the 'xAxis2' and 'legend'?Return to overview

I want to move the 'xAxis2' to the top right of the plot.
And I want to remove the margin between legend and plot border.

If there are ways, please let me know. thank you!

The legend margin is controlled with QCPLegend::setMargins, and further placement is controlled via the inset layout, see QCPLayoutInset (and QCustomPlot::insetLayout())

I'm not sure what you wish to do with xAxis2 though.

I was trying to display the (x,y) coordinates on the top right outside the plot using xAxis2.
But I solved this by looking at your answer to a question about 'itemText' I wrote under this question.
Thanks for your reply!