I am plotting xy-data using ListLinePlot with option InterpolationOrder->0 to get a step-like output. Now, the ticks are aligned to the rising part of the step (or vice versa), but I would like to have the ticks centered on the flat part of the step.

Same is true got ListPlot with option Joined->True.

How do I do this?


You can use ListStepPlot with "Center" as the second argument:

data={{1, 1}, {2, 2}, {3, 4}, {5, 8}, {8, 16}, {13, 32}, {21,64}};
ListStepPlot[data, "Center", PlotMarkers -> Automatic]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.