Skip to content

Commit

Permalink
Merge branch 'master' into sd/beta-20
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch authored Nov 17, 2023
2 parents 6ed5111 + 7027768 commit 2707505
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
23 changes: 15 additions & 8 deletions src/makielayout/blocks/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,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 @@ -1098,7 +1099,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 @@ -1123,9 +1125,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 @@ -1139,7 +1145,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 @@ -1158,9 +1165,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 @@ -1170,15 +1177,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 @@ -734,10 +734,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
4 changes: 2 additions & 2 deletions src/makielayout/lineaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ function create_linepoints(
return [from, to]
else
x = position
pstart = Point2f(-0.5f0 * tickwidth, 0)
pend = Point2f(0.5f0 * tickwidth, 0)
pstart = Point2f(0, -0.5f0 * tickwidth)
pend = Point2f(0, 0.5f0 * tickwidth)
from = trimspine[1] ? tickpositions[1] .+ pstart : Point2f(x, extents_oriented[1] - 0.5spine_width)
to = trimspine[2] ? tickpositions[end] .+ pend : Point2f(x, extents_oriented[2] + 0.5spine_width)
return [from, to]
Expand Down

0 comments on commit 2707505

Please sign in to comment.