Box

A simple rectangle poly that is block. This can be useful to make boxes for facet plots or when a rectangular placeholder is needed.

using CairoMakie
using ColorSchemes

fig = Figure()

rects = fig[1:4, 1:6] = [
    Box(fig, color = c)
    for c in get.(Ref(ColorSchemes.rainbow), (0:23) ./ 23)]

fig

Attributes

alignmode

Defaults to Inside()

The align mode of the rectangle in its parent GridLayout.

color

Defaults to RGBf(0.9, 0.9, 0.9)

The color of the rectangle.

halign

Defaults to :center

The horizontal alignment of the rectangle in its suggested boundingbox

height

Defaults to nothing

The height setting of the rectangle.

padding

Defaults to (0.0f0, 0.0f0, 0.0f0, 0.0f0)

The extra space added to the sides of the rectangle boundingbox.

strokecolor

Defaults to RGBf(0, 0, 0)

The color of the border.

strokevisible

Defaults to true

Controls if the border of the rectangle is visible.

strokewidth

Defaults to 1.0

The line width of the rectangle's border.

tellheight

Defaults to true

Controls if the parent layout can adjust to this element's height

tellwidth

Defaults to true

Controls if the parent layout can adjust to this element's width

valign

Defaults to :center

The vertical alignment of the rectangle in its suggested boundingbox

visible

Defaults to true

Controls if the rectangle is visible.

width

Defaults to nothing

The width setting of the rectangle.