barplot

AbstractPlotting.barplotFunction
barplot(x, y; kwargs...)

Plots a barplot; y defines the height. x and y should be 1 dimensional.

Attributes

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

  color        :black
  colormap     :viridis
  colorrange   AbstractPlotting.Automatic()
  direction    :y
  fillto       0.0
  marker       GeometryBasics.HyperRectangle
  strokecolor  :white
  strokewidth  0
  visible      true
  width        AbstractPlotting.Automatic()
source

Examples

using CairoMakie

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

xs = 1:0.2:10
ys = 0.5 .* sin.(xs)

barplot!(xs, ys, color = :red, strokecolor = :black, strokewidth = 1)
barplot!(xs, ys .- 1, fillto = -1, color = xs, strokecolor = :black, strokewidth = 1)

f