QCustomPlot Discussion and Comments

Why is my Y-Axis so messed up - Is this a widget size issue ?Return to overview

This is what my Y-Axis looks like

http://postimg.org/image/momjerqs9/

and this is the section for Y-Axis


	ui.myplot->yAxis->setAutoTickStep(false);
	ui.myplot->yAxis->setAutoSubTicks(false);
	ui.myplot->yAxis->setRange(0,19.75);
        ui.myplot->yAxis->setTickStep (0.05);
	ui.myplot->yAxis->setSubTickCount(10); 

It seems to me like QCustomPlot widget needs more space but I dont understand why this is so because I have QCP::iRangeDrag interaction set. If there was a need for more space I could have dragged the Qcustomplot widget. I wanted to know if there was a way for me to fix this without increasing the alloted space of the widget in my form ?

Well if you disable automatic tick steps, set the range to 0..19.75 and the tick step to a fixed value of 0.05, simple math will tell you that you get 395 ticks (and 3950 subticks) on that axis. And this is what you see.

It seems to me you're asking for something thats mathematically impossible. You can't display a large range with a small fixed tickstep and still not have ticks crammed up in a fixed size window.

Thanks for clearing that up. Is there a way to not have the values crammed up in a fixed size window. I mean have the QcustPlot display only the values till the visibility runs out. After which we can use zoom out or drag to see the further values ?

Do you mean like when just leaving the setAutoTickStep feature on? This adjust the tick step such that at every scale you have a certain amount of ticks in the range (controllable with setAutoTickCount).

Yeah that helps. I guess Ill let QCustomPlot handle TickStep