Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
ListPlot[{{0, 0}, {1, 1}, {2, 2}}, InterpolationOrder -> 0, Joined -> True] –  ssch Sep 18 '13 at 1:36
    
Perfect! Want to put that in an answer and I'll accept it? –  Sean Madsen Sep 18 '13 at 1:38
1  
Possible duplicates: 30055, 864 –  Michael E2 Sep 18 '13 at 1:43

1 Answer 1

up vote 4 down vote accepted

ListPlot can do this with the option InterpolationOrder -> 0

ListPlot[
   {{0, 0}, {1, 1}, {2, 2}},
   InterpolationOrder -> 0,
   Joined -> True]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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