From aa9b4e7f6b448dbdc9da3e906afe549304949a61 Mon Sep 17 00:00:00 2001 From: jkrumbiegel <22495855+jkrumbiegel@users.noreply.github.com> Date: Thu, 28 Jan 2021 22:37:38 +0100 Subject: [PATCH] jk/minor ticks (#620) --- docs/src/makielayout/laxis.md | 38 +++++++- src/makielayout/MakieLayout.jl | 2 +- src/makielayout/defaultattributes.jl | 68 ++++++++++++- src/makielayout/layoutables/axis.jl | 77 +++++++++++++-- src/makielayout/layoutables/colorbar.jl | 9 +- src/makielayout/lineaxis.jl | 102 ++++++++++++++++++-- src/makielayout/types.jl | 17 ++++ test/ReferenceTests/src/tests/examples2d.jl | 7 +- 8 files changed, 289 insertions(+), 31 deletions(-) diff --git a/docs/src/makielayout/laxis.md b/docs/src/makielayout/laxis.md index d6374cfb5..95aedd7ed 100755 --- a/docs/src/makielayout/laxis.md +++ b/docs/src/makielayout/laxis.md @@ -161,6 +161,42 @@ nothing # hide ![axis ticks](example_axis_ticks.svg) +## Minor Ticks and Grids + +You can show minor ticks and grids by setting `x/yminorticksvisible = true` and `x/yminorgridvisible = true` which are off by default. +You can set size, color, width, align etc. like for the normal ticks, but there are no labels. +The `x/yminorticks` attributes control how minor ticks are computed given major ticks and axis limits. +For that purpose you can create your own minortick type and overload `MakieLayout.get_minor_tickvalues(minorticks, tickvalues, vmin, vmax)`. + +The default minor tick type is `IntervalsBetween(n, mirror = true)` where `n` gives the number of intervals each gap between major ticks is divided into with minor ticks, and `mirror` decides if outside of the major ticks there are more minor ticks with the same intervals as the adjacent gaps. + +```@example +using CairoMakie + +theme = Attributes( + Axis = ( + xminorticksvisible = true, + yminorticksvisible = true, + xminorgridvisible = true, + yminorgridvisible = true, + ) +) + +fig = with_theme(theme) do + fig = Figure(resolution = (800, 800)) + axs = [Axis(fig[fldmod1(n, 2)...], + title = "IntervalsBetween($(n+1))", + xminorticks = IntervalsBetween(n+1), + yminorticks = IntervalsBetween(n+1)) for n in 1:4] + fig +end +save("example_minor_ticks.svg", fig) # hide +nothing # hide +``` + +![minor ticks](example_minor_ticks.svg) + + ## Hiding Axis Spines and Decorations You can hide all axis elements manually, by setting their specific visibility attributes to `false`, like @@ -186,7 +222,7 @@ nothing # hide ![axis hide spines](example_axis_hidespines.svg) To hide decorations, you can use `hidedecorations!`, or the specific `hidexdecorations!` and `hideydecorations!`. -When hiding, you can set `label = false`, `ticklabels = false`, `ticks = false` or `grid = false` as keyword +When hiding, you can set `label = false`, `ticklabels = false`, `ticks = false`, `grid = false`, `minorgrid = false` or `minorticks = false` as keyword arguments if you want to keep those elements. It's common, e.g., to hide everything but the grid lines in facet plots. diff --git a/src/makielayout/MakieLayout.jl b/src/makielayout/MakieLayout.jl index 9dbfdd803..b79cacbb1 100644 --- a/src/makielayout/MakieLayout.jl +++ b/src/makielayout/MakieLayout.jl @@ -79,7 +79,7 @@ export Textbox export linkxaxes!, linkyaxes!, linkaxes! export AxisAspect, DataAspect export autolimits!, limits! -export LinearTicks, WilkinsonTicks, MultiplesTicks +export LinearTicks, WilkinsonTicks, MultiplesTicks, IntervalsBetween export hidexdecorations!, hideydecorations!, hidedecorations!, hidespines! export tight_xticklabel_spacing!, tight_yticklabel_spacing!, tight_ticklabel_spacing!, tightlimits! export layoutscene diff --git a/src/makielayout/defaultattributes.jl b/src/makielayout/defaultattributes.jl index f918ad1b1..466cf9b61 100644 --- a/src/makielayout/defaultattributes.jl +++ b/src/makielayout/defaultattributes.jl @@ -126,13 +126,29 @@ function default_attributes(::Type{Axis}, scene) "The width of the y grid lines." ygridwidth = 1f0 "The color of the x grid lines." - xgridcolor = RGBAf0(0, 0, 0, 0.1) + xgridcolor = RGBAf0(0, 0, 0, 0.12) "The color of the y grid lines." - ygridcolor = RGBAf0(0, 0, 0, 0.1) + ygridcolor = RGBAf0(0, 0, 0, 0.12) "The linestyle of the x grid lines." xgridstyle = nothing "The linestyle of the y grid lines." ygridstyle = nothing + "Controls if the x minor grid lines are visible." + xminorgridvisible = false + "Controls if the y minor grid lines are visible." + yminorgridvisible = false + "The width of the x minor grid lines." + xminorgridwidth = 1f0 + "The width of the y minor grid lines." + yminorgridwidth = 1f0 + "The color of the x minor grid lines." + xminorgridcolor = RGBAf0(0, 0, 0, 0.05) + "The color of the y minor grid lines." + yminorgridcolor = RGBAf0(0, 0, 0, 0.05) + "The linestyle of the x minor grid lines." + xminorgridstyle = nothing + "The linestyle of the y minor grid lines." + yminorgridstyle = nothing "Controls if the bottom axis spine is visible." bottomspinevisible = true "Controls if the left axis spine is visible." @@ -168,11 +184,11 @@ function default_attributes(::Type{Axis}, scene) "The relative margins added to the autolimits in y direction." yautolimitmargin = (0.05f0, 0.05f0) "The xticks." - xticks = AbstractPlotting.automatic + xticks = LinearTicks(4) "Format for xticks." xtickformat = AbstractPlotting.automatic "The yticks." - yticks = AbstractPlotting.automatic + yticks = LinearTicks(4) "Format for yticks." ytickformat = AbstractPlotting.automatic "The button for panning." @@ -206,6 +222,30 @@ function default_attributes(::Type{Axis}, scene) yreversed = false "Controls if the x axis goes rightwards (false) or leftwards (true)" xreversed = false + "Controls if minor ticks on the x axis are visible" + xminorticksvisible = false + "The alignment of x minor ticks on the axis spine" + xminortickalign = 0f0 + "The tick size of x minor ticks" + xminorticksize = 5f0 + "The tick width of x minor ticks" + xminortickwidth = 1f0 + "The tick color of x minor ticks" + xminortickcolor = :black + "The tick locator for the x minor ticks" + xminorticks = IntervalsBetween(2) + "Controls if minor ticks on the y axis are visible" + yminorticksvisible = false + "The alignment of y minor ticks on the axis spine" + yminortickalign = 0f0 + "The tick size of y minor ticks" + yminorticksize = 5f0 + "The tick width of y minor ticks" + yminortickwidth = 1f0 + "The tick color of y minor ticks" + yminortickcolor = :black + "The tick locator for the y minor ticks" + yminorticks = IntervalsBetween(2) end (attributes = attrs, documentation = docdict, defaults = defaultdict) @@ -248,7 +288,7 @@ function default_attributes(::Type{Colorbar}, scene) "Controls if the tick marks are visible." ticksvisible = true "The ticks." - ticks = AbstractPlotting.automatic + ticks = LinearTicks(4) "Format for ticks." tickformat = AbstractPlotting.automatic "The space reserved for the tick labels." @@ -311,6 +351,18 @@ function default_attributes(::Type{Colorbar}, scene) highclip = nothing "The color of the low clip triangle." lowclip = nothing + "Controls if minor ticks are visible" + minorticksvisible = false + "The alignment of minor ticks on the axis spine" + minortickalign = 0f0 + "The tick size of minor ticks" + minorticksize = 5f0 + "The tick width of minor ticks" + minortickwidth = 1f0 + "The tick color of minor ticks" + minortickcolor = :black + "The tick locator for the minor ticks" + minorticks = IntervalsBetween(5) end (attributes = attrs, documentation = docdict, defaults = defaultdict) end @@ -500,6 +552,12 @@ function default_attributes(::Type{LineAxis}) ticklabelpad = 5f0, labelpadding = 15f0, reversed = false, + minorticksvisible = true, + minortickalign = 0f0, + minorticksize = 5f0, + minortickwidth = 1f0, + minortickcolor = :black, + minorticks = AbstractPlotting.automatic, ) end diff --git a/src/makielayout/layoutables/axis.jl b/src/makielayout/layoutables/axis.jl index 200961b3f..ba3a48863 100644 --- a/src/makielayout/layoutables/axis.jl +++ b/src/makielayout/layoutables/axis.jl @@ -34,6 +34,10 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n backgroundcolor, xlabelfont, ylabelfont, xticklabelfont, yticklabelfont, flip_ylabel, xreversed, yreversed, + xminorticksvisible, xminortickalign, xminorticksize, xminortickwidth, xminortickcolor, xminorticks, + yminorticksvisible, yminortickalign, yminorticksize, yminortickwidth, yminortickcolor, yminorticks, + xminorgridvisible, yminorgridvisible, xminorgridwidth, yminorgridwidth, + xminorgridcolor, yminorgridcolor, xminorgridstyle, yminorgridstyle ) decorations = Dict{Symbol, Any}() @@ -68,6 +72,15 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n translate!(xgridlines, 0, 0, -10) decorations[:xgridlines] = xgridlines + xminorgridnode = Node(Point2f0[]) + xminorgridlines = linesegments!( + topscene, xminorgridnode, linewidth = xminorgridwidth, show_axis = false, visible = xminorgridvisible, + color = xminorgridcolor, linestyle = xminorgridstyle, + ) + # put gridlines behind the zero plane so they don't overlay plots + translate!(xminorgridlines, 0, 0, -10) + decorations[:xminorgridlines] = xminorgridlines + ygridnode = Node(Point2f0[]) ygridlines = linesegments!( topscene, ygridnode, linewidth = ygridwidth, show_axis = false, visible = ygridvisible, @@ -77,6 +90,15 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n translate!(ygridlines, 0, 0, -10) decorations[:ygridlines] = ygridlines + yminorgridnode = Node(Point2f0[]) + yminorgridlines = linesegments!( + topscene, yminorgridnode, linewidth = yminorgridwidth, show_axis = false, visible = yminorgridvisible, + color = yminorgridcolor, linestyle = yminorgridstyle, + ) + # put gridlines behind the zero plane so they don't overlay plots + translate!(yminorgridlines, 0, 0, -10) + decorations[:yminorgridlines] = yminorgridlines + onany(limits, xreversed, yreversed) do lims, xrev, yrev nearclip = -10_000f0 @@ -154,7 +176,9 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n ticklabelspace = xticklabelspace, ticks = xticks, tickformat = xtickformat, ticklabelsvisible = xticklabelsvisible, ticksvisible = xticksvisible, spinevisible = xspinevisible, spinecolor = xspinecolor, spinewidth = spinewidth, ticklabelsize = xticklabelsize, trimspine = xtrimspine, ticksize = xticksize, - reversed = xreversed, tickwidth = xtickwidth, tickcolor = xtickcolor) + reversed = xreversed, tickwidth = xtickwidth, tickcolor = xtickcolor, + minorticksvisible = xminorticksvisible, minortickalign = xminortickalign, minorticksize = xminorticksize, minortickwidth = xminortickwidth, minortickcolor = xminortickcolor, minorticks = xminorticks, + ) decorations[:xaxis] = xaxis yaxis = LineAxis(topscene, endpoints = yaxis_endpoints, limits = lift(ylimits, limits), @@ -165,7 +189,9 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n ticklabelspace = yticklabelspace, ticks = yticks, tickformat = ytickformat, ticklabelsvisible = yticklabelsvisible, ticksvisible = yticksvisible, spinevisible = yspinevisible, spinecolor = yspinecolor, spinewidth = spinewidth, trimspine = ytrimspine, ticklabelsize = yticklabelsize, ticksize = yticksize, flip_vertical_label = flip_ylabel, reversed = yreversed, tickwidth = ytickwidth, - tickcolor = ytickcolor) + tickcolor = ytickcolor, + minorticksvisible = yminorticksvisible, minortickalign = yminortickalign, minorticksize = yminorticksize, minortickwidth = yminortickwidth, minortickcolor = yminortickcolor, minorticks = yminorticks, + ) decorations[:yaxis] = yaxis @@ -221,6 +247,20 @@ function layoutable(::Type{<:Axis}, fig_or_scene::Union{Figure, Scene}; bbox = n ygridnode[] = interleave_vectors(tickpos, opposite_tickpos) end + on(xaxis.minortickpositions) do tickpos + pxheight = height(scene.px_area[]) + offset = xaxisposition[] == :bottom ? pxheight : -pxheight + opposite_tickpos = tickpos .+ Ref(Point2f0(0, offset)) + xminorgridnode[] = interleave_vectors(tickpos, opposite_tickpos) + end + + on(yaxis.minortickpositions) do tickpos + pxwidth = width(scene.px_area[]) + offset = yaxisposition[] == :left ? pxwidth : -pxwidth + opposite_tickpos = tickpos .+ Ref(Point2f0(offset, 0)) + yminorgridnode[] = interleave_vectors(tickpos, opposite_tickpos) + end + titlepos = lift(scene.px_area, titlegap, titlealign, xaxisposition, xaxis.protrusion) do a, titlegap, align, xaxisposition, xaxisprotrusion @@ -707,11 +747,13 @@ function add_reset_limits!(la::Axis) end """ - hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true) + 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. """ -function hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true) +function hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true, + minorgrid = true, minorticks = true) if label la.xlabelvisible = false end @@ -724,14 +766,22 @@ function hidexdecorations!(la::Axis; label = true, ticklabels = true, ticks = tr if grid la.xgridvisible = false end + if minorgrid + la.xminorgridvisible = false + end + if minorticks + la.xminorticksvisible = false + end end """ - hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true) + 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. """ -function hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true) +function hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true, + minorgrid = true, minorticks = true) if label la.ylabelvisible = false end @@ -744,6 +794,12 @@ function hideydecorations!(la::Axis; label = true, ticklabels = true, ticks = tr if grid la.ygridvisible = false end + if minorgrid + la.yminorgridvisible = false + end + if minorticks + la.yminorticksvisible = false + end end """ @@ -751,9 +807,12 @@ end Hide decorations of both x and y-axis: label, ticklabels, ticks and grid. """ -function hidedecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true) - hidexdecorations!(la; label = label, ticklabels = ticklabels, ticks = ticks, grid = grid) - hideydecorations!(la; label = label, ticklabels = ticklabels, ticks = ticks, grid = grid) +function hidedecorations!(la::Axis; label = true, ticklabels = true, ticks = true, grid = true, + minorgrid = true, minorticks = true) + hidexdecorations!(la; label = label, ticklabels = ticklabels, ticks = ticks, grid = grid, + minorgrid = minorgrid, minorticks = minorticks) + hideydecorations!(la; label = label, ticklabels = ticklabels, ticks = ticks, grid = grid, + minorgrid = minorgrid, minorticks = minorticks) end """ diff --git a/src/makielayout/layoutables/colorbar.jl b/src/makielayout/layoutables/colorbar.jl index 793364403..675422422 100644 --- a/src/makielayout/layoutables/colorbar.jl +++ b/src/makielayout/layoutables/colorbar.jl @@ -54,7 +54,8 @@ function layoutable(::Type{<:Colorbar}, fig_or_scene; bbox = nothing, kwargs...) rightspinevisible, leftspinevisible, bottomspinevisible, topspinecolor, leftspinecolor, rightspinecolor, bottomspinecolor, colormap, limits, halign, valign, vertical, flipaxisposition, ticklabelalign, flip_vertical_label, - nsteps, highclip, lowclip) + nsteps, highclip, lowclip, + minorticksvisible, minortickalign, minorticksize, minortickwidth, minortickcolor, minorticks) decorations = Dict{Symbol, Any}() @@ -252,7 +253,11 @@ function layoutable(::Type{<:Colorbar}, fig_or_scene; bbox = nothing, kwargs...) ticksvisible = ticksvisible, ticklabelpad = ticklabelpad, tickalign = tickalign, tickwidth = tickwidth, tickcolor = tickcolor, spinewidth = spinewidth, ticklabelspace = ticklabelspace, ticklabelcolor = ticklabelcolor, - spinecolor = :transparent, spinevisible = :false, flip_vertical_label = flip_vertical_label) + spinecolor = :transparent, spinevisible = :false, flip_vertical_label = flip_vertical_label, + minorticksvisible = minorticksvisible, minortickalign = minortickalign, + minorticksize = minorticksize, minortickwidth = minortickwidth, + minortickcolor = minortickcolor, minorticks = minorticks) + decorations[:axis] = axis onany(axis.protrusion, vertical, flipaxisposition) do axprotrusion, diff --git a/src/makielayout/lineaxis.jl b/src/makielayout/lineaxis.jl index 69e5b5390..cfdefe7cf 100644 --- a/src/makielayout/lineaxis.jl +++ b/src/makielayout/lineaxis.jl @@ -9,7 +9,8 @@ function LineAxis(parent::Scene; kwargs...) ticklabelspace, ticklabelpad, labelpadding, ticklabelsize, ticklabelsvisible, spinewidth, spinecolor, label, labelsize, labelcolor, labelfont, ticklabelfont, ticklabelcolor, - labelvisible, spinevisible, trimspine, flip_vertical_label, reversed) + labelvisible, spinevisible, trimspine, flip_vertical_label, reversed, + minorticksvisible, minortickalign, minorticksize, minortickwidth, minortickcolor, minorticks) pos_extents_horizontal = lift(endpoints) do endpoints if endpoints[1][2] == endpoints[2][2] @@ -35,6 +36,13 @@ function LineAxis(parent::Scene; kwargs...) decorations[:ticklines] = ticklines translate!(ticklines, 0, 0, 10) + minorticksnode = Node(Point2f0[]) + minorticklines = linesegments!( + parent, minorticksnode, linewidth = minortickwidth, color = minortickcolor, + show_axis = false, visible = minorticksvisible + ) + decorations[:minorticklines] = minorticklines + ticklabelannosnode = Node(Tuple{String, Point2f0}[]) ticklabels = annotations!( parent, @@ -186,6 +194,50 @@ function LineAxis(parent::Scene; kwargs...) tickstrings[] = tickstrings_unfiltered[i_values_within_limits] end + minortickvalues = Node(Float32[]) + minortickpositions = Node(Point2f0[]) + + onany(tickvalues, minorticks) do tickvalues, minorticks + minortickvalues[] = get_minor_tickvalues(minorticks, tickvalues, limits[]...) + end + + onany(minortickvalues) do minortickvalues + position, extents_uncorrected, horizontal = pos_extents_horizontal[] + + extents = reversed[] ? reverse(extents_uncorrected) : extents_uncorrected + + px_o = extents[1] + px_width = extents[2] - extents[1] + + lim_o = limits[][1] + lim_w = limits[][2] - limits[][1] + + tick_fractions = (minortickvalues .- lim_o) ./ lim_w + tick_scenecoords = px_o .+ px_width .* tick_fractions + + minortickpositions[] = if horizontal + [Point(x, position) for x in tick_scenecoords] + else + [Point(position, y) for y in tick_scenecoords] + end + end + + onany(minortickpositions, minortickalign, minorticksize, spinewidth) do tickpositions, + tickalign, ticksize, spinewidth + + position, extents, horizontal = pos_extents_horizontal[] + + if horizontal + tickstarts = [tp + (flipped[] ? -1f0 : 1f0) * Point2f0(0f0, tickalign * ticksize - 0.5f0 * spinewidth) for tp in tickpositions] + tickends = [t + (flipped[] ? -1f0 : 1f0) * Point2f0(0f0, -ticksize) for t in tickstarts] + minorticksnode[] = interleave_vectors(tickstarts, tickends) + else + tickstarts = [tp + (flipped[] ? -1f0 : 1f0) * Point2f0(tickalign * ticksize - 0.5f0 * spinewidth, 0f0) for tp in tickpositions] + tickends = [t + (flipped[] ? -1f0 : 1f0) * Point2f0(-ticksize, 0f0) for t in tickstarts] + minorticksnode[] = interleave_vectors(tickstarts, tickends) + end + end + onany(tickstrings, labelgap, flipped) do tickstrings, labelgap, flipped # tickspace is always updated before labelgap # tickpositions are always updated before tickstrings @@ -277,7 +329,7 @@ function LineAxis(parent::Scene; kwargs...) # etc to avoid empty ticks bug #69 limits[] = limits[] - LineAxis(parent, protrusion, attrs, decorations, tickpositions, tickvalues, tickstrings) + LineAxis(parent, protrusion, attrs, decorations, tickpositions, tickvalues, tickstrings, minortickpositions, minortickvalues) end @@ -352,13 +404,6 @@ function get_ticks(tickfunction::Function, formatter, vmin, vmax) return tickvalues, ticklabels end -""" - get_tickvalues(::AbstractPlotting.Automatic, vmin, vmax) - -Calls the default tick finding algorithm, which could depend on the current Axis -state. -""" -get_tickvalues(::AbstractPlotting.Automatic, vmin, vmax) = get_tickvalues(LinearTicks(5), vmin, vmax) """ get_tickvalues(lt::LinearTicks, vmin, vmax) @@ -405,3 +450,42 @@ function get_ticks(m::MultiplesTicks, ::AbstractPlotting.Automatic, vmin, vmax) multiples .* m.multiple, Showoff.showoff(multiples) .* m.suffix end + + +function get_minor_tickvalues(i::IntervalsBetween, tickvalues, vmin, vmax) + vals = Float32[] + length(tickvalues) < 2 && return vals + n = i.n + + if i.mirror + firstinterval = tickvalues[2] - tickvalues[1] + stepsize = firstinterval / n + v = tickvalues[1] - stepsize + while v >= vmin + pushfirst!(vals, v) + v -= stepsize + end + end + + for (lo, hi) in zip(@view(tickvalues[1:end-1]), @view(tickvalues[2:end])) + interval = hi - lo + stepsize = interval / n + v = lo + for i in 1:n-1 + v += stepsize + push!(vals, v) + end + end + + if i.mirror + lastinterval = tickvalues[end] - tickvalues[end-1] + stepsize = lastinterval / n + v = tickvalues[end] + stepsize + while v <= vmax + push!(vals, v) + v += stepsize + end + end + + vals +end \ No newline at end of file diff --git a/src/makielayout/types.jl b/src/makielayout/types.jl index b4a1bbddb..b7b87d277 100644 --- a/src/makielayout/types.jl +++ b/src/makielayout/types.jl @@ -50,6 +50,21 @@ struct MultiplesTicks suffix::String end +""" + IntervalsBetween(n::Int, mirror::Bool = true) + +Indicates to create n-1 minor ticks between every pair of adjacent major ticks. +""" +struct IntervalsBetween + n::Int + mirror::Bool + function IntervalsBetween(n::Int, mirror::Bool) + n < 2 && error("You can't have $n intervals (must be at least 2 which means 1 minor tick)") + new(n, mirror) + end +end +IntervalsBetween(n) = IntervalsBetween(n, true) + mutable struct LineAxis parent::Scene @@ -59,6 +74,8 @@ mutable struct LineAxis tickpositions::Node{Vector{Point2f0}} tickvalues::Node{Vector{Float32}} ticklabels::Node{Vector{String}} + minortickpositions::Node{Vector{Point2f0}} + minortickvalues::Node{Vector{Float32}} end struct LimitReset end diff --git a/test/ReferenceTests/src/tests/examples2d.jl b/test/ReferenceTests/src/tests/examples2d.jl index f852c1f1d..0246103e0 100644 --- a/test/ReferenceTests/src/tests/examples2d.jl +++ b/test/ReferenceTests/src/tests/examples2d.jl @@ -283,17 +283,16 @@ end @cell "Simple pie chart" begin fig = Figure(resolution=(800, 800)) - ax = fig[1, 1] = Axis(fig, autolimitaspect=1) - pie!(ax, 1:5, color=1:5) + pie(fig[1, 1], 1:5, color=collect(1:5), axis=(;aspect=DataAspect())) fig end @cell "Hollow pie chart" begin - pie(1:5, color=1:5, radius=2, inner_radius=1, axis=(;autolimitaspect=1)) + pie(1:5, color=collect(1.0:5), radius=2, inner_radius=1, axis=(;aspect=DataAspect())) end @cell "Open pie chart" begin - pie(0.1:0.1:1.0, normalize=false, axis=(;autolimitaspect=1)) + pie(0.1:0.1:1.0, normalize=false, axis=(;aspect=DataAspect())) end @cell "intersecting polygon" begin