band

AbstractPlotting.bandFunction

band(x, ylower, yupper; kwargs...) band(lower, upper; kwargs...)

Plots a band from ylower to yupper along x.

Attributes

Available attributes and their defaults for Band{T} where T are:

  ambient         Float32[0.55, 0.55, 0.55]
  color           RGBA{Float32}(0.0f0,0.0f0,0.0f0,0.2f0)
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  diffuse         Float32[0.4, 0.4, 0.4]
  interpolate     false
  lightposition   :eyeposition
  linewidth       1
  nan_color       RGBA{Float32}(0.0f0,0.0f0,0.0f0,0.0f0)
  overdraw        false
  shading         true
  shininess       32.0f0
  specular        Float32[0.2, 0.2, 0.2]
  ssao            false
  transparency    false
  visible         true
source

Examples

using CairoMakie

f = Figure(resolution = (800, 600))
Axis(f[1, 1])

xs = 1:0.2:10
ys_low = -0.2 .* sin.(xs) .- 0.25
ys_high = 0.2 .* sin.(xs) .+ 0.25

band!(xs, ys_low, ys_high)
band!(xs, ys_low .- 1, ys_high .-1, color = :red)

f
using Statistics
using CairoMakie

f = Figure(resolution = (800, 600))
Axis(f[1, 1])

n, m = 100, 101
t = range(0, 1, length=m)
X = cumsum(randn(n, m), dims = 2)
X = X .- X[:, 1]
μ = vec(mean(X, dims=1)) # mean
lines!(t, μ)              # plot mean line
σ = vec(std(X, dims=1))  # stddev
band!(t, μ + σ, μ - σ)   # plot stddev band

f