3

What's a simple way to plot a list of points so that they're joined with stair steps instead of straight lines between the points?

I'd imagine something like...

stairStepListPlot[{{0,0},{1,1},{2,2}}]

...would produce a flat line from {0,0} to {1,0}, then a vertical line from {1,0} to {1,1} and so on.

Can you find a concise way of producing such a plot?

Sean
  • 535
  • 4
  • 10

1 Answers1

7

ListPlot can do this with the option InterpolationOrder -> 0

ListPlot[
   {{0, 0}, {1, 1}, {2, 2}},
   InterpolationOrder -> 0,
   Joined -> True]
ssch
  • 16,590
  • 2
  • 53
  • 88