1 Attachment(s)
setAxisMaxMajor not respected by log scale engine?
Hi all, I'm plotting a curve using a QwtLogScaleEngine for the xTop axis:
QwtLogScaleEngine *engine = new QwtLogScaleEngine();
setAxisScaleEngine(QwtPlot::xTop, engine);
I'm also trying to use setAxisMaxMajor(QwtPlot::xTop, 2) to limit the number of major scale intervals to 2.
But the result is that I still get 3 major intervals on the xTop axis:
Attachment 12124
Is setAxisMaxMajor(..) not supposed to take effect when using a QwtLogScaleEngine ?
Thanks in advance.
Re: setAxisMaxMajor not respected by log scale engine?
QwtPlot::setAxisMaxMajor() is a limit for the ticks - the number of intervals is then always one more.
What you might want to do is:
Code:
setAxisMaxMajor
(QwtPlot::xTop, numIntervals
- 1 );
Uwe
Re: setAxisMaxMajor not respected by log scale engine?
Aha, I see. I think the docs might need updating. They currently say: "Set the maximum number of major scale intervals for a specified axis".
But I'm still a little confused. The number of intervals should be one less than the number of ticks, shouldn't it?
Or are the axis start/end not counted as "ticks" in this case? If so I guess I should pass 1 as parameter. I'll give it a try when I'm back at work in ~20 min.
Thanks for the help!