stairs

stairs(xs, ys; kwargs...)

Plot a stair function.

The step parameter can take the following values:

  • :pre: horizontal part of step extends to the left of each value in xs.

  • :post: horizontal part of step extends to the right of each value in xs.

  • :center: horizontal part of step extends halfway between the two adjacent values of xs.

The conversion trait of stem is PointBased.

Attributes

Available attributes and their defaults for Combined{Makie.stairs} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      MakieCore.Automatic()
  colorscale      identity
  cycle           [:color]
  depth_shift     0.0f0
  highclip        MakieCore.Automatic()
  inspectable     true
  linestyle       "nothing"
  linewidth       1.5
  lowclip         MakieCore.Automatic()
  nan_color       :transparent
  overdraw        false
  space           :data
  ssao            false
  step            :pre
  transparency    false
  visible         true

Examples

using CairoMakie


f = Figure()

xs = LinRange(0, 4pi, 21)
ys = sin.(xs)

stairs(f[1, 1], xs, ys)
stairs(f[2, 1], xs, ys; step=:post, color=:blue, linestyle=:dash)
stairs(f[3, 1], xs, ys; step=:center, color=:red, linestyle=:dot)

f