it is possible to get a histogram style in ListPlot
using InterpolationOrder->0
testdata = {{1, 3}, {3, 4}, {4, 3}, {5, 8}, {7, 6}, {9, 4}};
ListPlot[testdata, Joined -> True, InterpolationOrder -> 0,
Epilog -> {PointSize[Large], Point[testdata]}]
Note that the data points are sitting at the corner of the histograms at the left end of the horizontal lines. My question is:
How could I plot the same data set with the data points being centered on the horizontal line segments? For equidistant data points this is of course a simple shift. But how to do this for irregularly gridded data?
Edit 1:
To clarify: Of course this is possibly not very meaningfull in irregularly spaced cases, and centered is the wrong term, however, in the example case the data point connection I was looking for could look like the following:
Plot[Evaluate[Last[First[testdata]] + Differences[Last /@ testdata].UnitStep[x - ListConvolve[{1, 1}/2, First /@ testdata]]], {x, 0, 10}, Axes -> None, Epilog -> {AbsolutePointSize[5], Point /@ testdata}, Frame -> True]
suit your needs? $\endgroup$