QCustomPlot Discussion and Comments

A vertical line on x axisReturn to overview

Dear DerManu,

Could you advise me how to make a vertical line on x axis to represent the current comment?
Many thanks.


Have a look at the QCPItemLine or QCPItemStraightLine (if it should span infinitely, e.g. over the axis rect).
If by vertical line you mean a tick on the axis, you might also be interested in controlling the ticks manually. This is explained in the basics plotting tutorial, I'll quote:

However, you can take full control over the tick-step and even the single tick mark positions by calling setTickStep or setTickVector on the respective axis. For disabling or enabling the automation, call setAutoTickStep or setAutoTicks. Disabling the automation will be necessary, if you want to provide your own tick step or tick vector.