Staircase (or step) plot using Plots.jl

How can I produce a staircase (some may call it step) plot for a given array? Something along the line of step function in Matplotlib ( The only solution I can found is the stairs function provided by the Unicodeplot package (

1 Like

In Plots.jl just use:

using Plots
plot(1:100, 1:100, linetype=:steppre)


plot(1:100, 1:100, linetype=:steppost)

You could also just use the PyPlot interface to Matplotlib.


Excellent! Thank you a million.

I do feel a little bit stupid that while searching the page back and forth it did not occur to me that something called steppre was what I had been looking for.

1 Like

Glad that helped!

1 Like