The subticks in my plot are quite close to each other. Is there any way I could increase the distance between them ?
The subticks in my plot are quite close to each other. Is there any way I could increase the distance between them ?
Yes, decrease their number by
customPlot->xAxis->setSubTickCount(...);
I currently have
customPlot->xAxis->setSubTickCount(5);
this gives me 5 subticks between two ticks and I want to keep it that way.
If I change
customPlot->xAxis->setSubTickCount(2);
this will only give me two subticks between two ticks. which i dont want. I actually want to keep 5 subticks and increase the distance between the subticks so they are a little farther apart..In short I want 5 subticks between two ticks only with increased spacing between two adjacent subticks.
Well then you need to increase your tick step if auto-tickstep is off :)
If it is on, you can decrease the number of ticks QCP tries to create in the current range via xAxis->setAutoTickCount
This is my current code
ui.myplot->xAxis->setAutoTickStep(false); ui.myplot->xAxis->setAutoSubTicks(false); ui.myplot->xAxis->setTickStep(5); ui.myplot->xAxis->setSubTickCount(5); ui.myplot->xAxis->setRange(795, 900); ui.myplot->xAxis->setSubTickLength(3); ui.myplot->xAxis->setTickLength(10);
I want to prserve the same code tickstrp and tickcount only increase the distance between subticks. Thus further elongating an image. Any suggestions.
Ah okay, then you need to stretch your widget or window. For example by using setGeometry on your main window, or setting different minimum sizes on the QCustomPlot widget.