Skip to content

Commit

Permalink
Docstring improvements for hidedecorations!, etc. (#3363)
Browse files Browse the repository at this point in the history
* add details to hidedecorations!, other docstring fixes

* add a "see also", remove some invalid keywords from Axis3 docstring

* remove `@ref`
  • Loading branch information
jwahlstrand authored Nov 16, 2023
1 parent 531d42d commit 6778cd1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
23 changes: 15 additions & 8 deletions src/makielayout/blocks/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,8 @@ end
hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
Hide decorations of the x-axis: label, ticklabels, ticks and grid.
Hide decorations of the x-axis: label, ticklabels, ticks and grid. Keyword
arguments can be used to disable hiding of certain types of decorations.
"""
function hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
Expand Down Expand Up @@ -1134,7 +1135,8 @@ end
hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
Hide decorations of the y-axis: label, ticklabels, ticks and grid.
Hide decorations of the y-axis: label, ticklabels, ticks and grid. Keyword
arguments can be used to disable hiding of certain types of decorations.
"""
function hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
Expand All @@ -1159,9 +1161,13 @@ function hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = tr
end

"""
hidedecorations!(la::Axis)
hidedecorations!(la::Axis; label = true, ticklabels = true, ticks = true,
grid = true, minorgrid = true, minorticks = true)
Hide decorations of both x and y-axis: label, ticklabels, ticks and grid.
Keyword arguments can be used to disable hiding of certain types of decorations.
See also [`hidexdecorations!`], [`hideydecorations!`], [`hidezdecorations!`]
"""
function hidedecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
Expand All @@ -1175,7 +1181,8 @@ end
hidespines!(la::Axis, spines::Symbol... = (:l, :r, :b, :t)...)
Hide all specified axis spines. Hides all spines by default, otherwise choose
with the symbols :l, :r, :b and :t.
which sides to hide with the symbols :l (left), :r (right), :b (bottom) and
:t (top).
"""
function hidespines!(la::Axis, spines::Symbol... = (:l, :r, :b, :t)...)
for s in spines
Expand All @@ -1194,9 +1201,9 @@ function hidespines!(la::Axis, spines::Symbol... = (:l, :r, :b, :t)...)
end

"""
space = tight_xticklabel_spacing!(ax::Axis)
space = tight_yticklabel_spacing!(ax::Axis)
Sets the space allocated for the xticklabels of the `Axis` to the minimum that is needed and returns that value.
Sets the space allocated for the yticklabels of the `Axis` to the minimum that is needed and returns that value.
"""
function tight_yticklabel_spacing!(ax::Axis)
space = tight_ticklabel_spacing!(ax.yaxis)
Expand All @@ -1206,15 +1213,15 @@ end
"""
space = tight_xticklabel_spacing!(ax::Axis)
Sets the space allocated for the yticklabels of the `Axis` to the minimum that is needed and returns that value.
Sets the space allocated for the xticklabels of the `Axis` to the minimum that is needed and returns that value.
"""
function tight_xticklabel_spacing!(ax::Axis)
space = tight_ticklabel_spacing!(ax.xaxis)
return space
end

"""
tight_ticklabel_spacing(ax::Axis)
tight_ticklabel_spacing!(ax::Axis)
Sets the space allocated for the xticklabels and yticklabels of the `Axis` to the minimum that is needed.
"""
Expand Down
6 changes: 3 additions & 3 deletions src/makielayout/blocks/axis3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,10 @@ function hideydecorations!(ax::Axis3;
end

"""
hidezdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true,
minorgrid = true, minorticks = true)
hidezdecorations!(ax::Axis3; label = true, ticklabels = true, ticks = true, grid = true)
Hide decorations of the z-axis: label, ticklabels, ticks and grid.
Hide decorations of the z-axis: label, ticklabels, ticks and grid. Keyword
arguments can be used to disable hiding of certain types of decorations.
"""
function hidezdecorations!(ax::Axis3;
label = true, ticklabels = true, ticks = true, grid = true)
Expand Down

0 comments on commit 6778cd1

Please sign in to comment.