PDA

View Full Version : Qwt with labeled x-axis



goocreations
12th May 2011, 09:00
Hi

I have a QwtPlot with a x- and y-axis and presenting a histogram.
I want the y-axis to display values from 0 - 100 (which is default in QwtPlot and not a problem).
However, I want the x-axis to display labels instead of values. So instead of number on the x-axis, I want a number of labels to be displayed underneath each histogram bar.

Any help would be appreciated.

pkj
12th May 2011, 15:51
Please follow friedberg and cpuplot example which came along qwt. basically you have to subclass QwtScaleDraw. In the virtual label function, put in a logic which returns the string you want for a given x axis value. HTH.