QCustomPlot Discussion and Comments

Cant customize ticks in x-axis. Am I doing it rightReturn to overview

My plotting data is something like this

x = 800 , 805 , 810, 815 , 820
y = 45 , 60 , 90 , 130 , 300

Now I want my x-axis to start from 800 and have 5 ticks in between it like this

|--------|--------|----------|------------|
800 805 810 815 820

Here is how I am doing it

ui.myplot->xAxis->setAutoTicks(false);
	ui.myplot->xAxis->setAutoTickStep(false);
	ui.myplot->xAxis->setAutoSubTicks(false);

	ui.myplot->xAxis->setTickStep(5);
	ui.myplot->xAxis->setSubTickCount(5);
	ui.myplot->xAxis->setRangeLower(800);
	ui.myplot->xAxis->setRangeUpper(820);

However I am not getting the expected result it seems like the x-axis starts starts with 0,0.8 etc. Any ideas why I am not getting the desired result

You don't want to disable auto ticks, because you still want QCP to generate ticks and tick labels for you. So remove the line
ui.myplot->xAxis->setAutoTicks(false);
and it should work.

Thanks that did the trick

Where is setAutoTickStep() now?