diff --git a/src/makielayout/blocks/axis3d.jl b/src/makielayout/blocks/axis3d.jl index 6b8c4649ce9..860a59aa6ea 100644 --- a/src/makielayout/blocks/axis3d.jl +++ b/src/makielayout/blocks/axis3d.jl @@ -1137,5 +1137,28 @@ function attribute_examples(::Type{Axis3}) """ ), ], + :protrusions => [ + Example( + name = "Single protrusion", + code = """ + fig = Figure(backgroundcolor = :gray97) + Box(fig[1, 1], strokewidth = 0) # visualizes the layout cell + Axis3(fig[1, 1], protrusions = 100, viewmode = :stretch, + title = "protrusions = 100") + fig + """ + ), + Example( + name = "Removing protrusions", + code = """ + fig = Figure(backgroundcolor = :gray97) + Box(fig[1, 1], strokewidth = 0) # visualizes the layout cell + ax = Axis3(fig[1, 1], protrusions = (0, 0, 0, 20), viewmode = :stretch, + title = "protrusions = (0, 0, 0, 20)") + hidedecorations!(ax) + fig + """ + ), + ] ) end diff --git a/src/makielayout/types.jl b/src/makielayout/types.jl index d5aa74f1494..47228158bed 100644 --- a/src/makielayout/types.jl +++ b/src/makielayout/types.jl @@ -1547,7 +1547,19 @@ end ygridvisible = true "Controls if the z grid is visible" zgridvisible = true - "The protrusions on the sides of the axis, how much gap space is reserved for labels etc." + """ + The protrusions control how much gap space is reserved for labels etc. on the sides of the `Axis3`. + Unlike `Axis`, `Axis3` currently does not set these values automatically depending on the properties + of ticks and labels. This is because the effective protrusions also depend on the rotation and scaling + of the axis cuboid, which changes whenever the `Axis3` shifts in the layout. Therefore, auto-updating + protrusions could lead to an endless layout update cycle. + + The default value of `30` for all sides is just a heuristic and might lead to collisions of axis + decorations with the `Figure` boundary or other plot elements. If that's the case, you can try increasing + the value(s). + + The `protrusions` attribute accepts a single number for all sides, or a tuple of `(left, right, bottom, top)`. + """ protrusions = 30 "The x ticks" xticks = WilkinsonTicks(5; k_min = 3)