crossbar

crossbar(x, y, ymin, ymax; kwargs...)

Draw a crossbar. A crossbar represents a range with a (potentially notched) box. It is most commonly used as part of the boxplot.

Arguments

  • x: position of the box

  • y: position of the midline within the box

  • ymin: lower limit of the box

  • ymax: upper limit of the box

Plot type

The plot type alias for the crossbar function is CrossBar.

Attributes

color = @inherit patchcolorNo docs available.

colormap = @inherit colormapNo docs available.

colorrange = automaticNo docs available.

colorscale = identityNo docs available.

cycle = [:color => :patchcolor]No docs available.

dodge = automaticNo docs available.

dodge_gap = 0.03No docs available.

gap = 0.2 — Shrinking factor, width -> width * (1 - gap).

inspectable = @inherit inspectableNo docs available.

midlinecolor = automaticNo docs available.

midlinewidth = @inherit linewidthNo docs available.

n_dodge = automaticNo docs available.

notchmax = automatic — Upper limit of the notch.

notchmin = automatic — Lower limit of the notch.

notchwidth = 0.5 — Multiplier of width for narrowest width of notch.

orientation = :vertical — Orientation of box (:vertical or :horizontal).

show_midline = true — Show midline.

show_notch = false — Whether to draw the notch.

strokecolor = @inherit patchstrokecolorNo docs available.

strokewidth = @inherit patchstrokewidthNo docs available.

width = automatic — Width of the box before shrinking.

Examples

using CairoMakie


xs = [1, 1, 2, 2, 3, 3]
ys = rand(6)
ymins = ys .- 1
ymaxs = ys .+ 1
dodge = [1, 2, 1, 2, 1, 2]

crossbar(xs, ys, ymins, ymaxs, dodge = dodge, show_notch = true)