Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reintroduce vmin, vmax into get_ticks; addresses #4441 #4442

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/makielayout/lineaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,7 @@

Convert tickvalues to a float array by default.
"""
get_tickvalues(tickvalues, vmin, vmax) = convert(Vector{Float64}, tickvalues)

get_tickvalues(tickvalues, vmin, vmax) = filter(p -> p >= vmin && p <= vmax, convert(Vector{Float64}, tickvalues))

Check warning on line 631 in src/makielayout/lineaxis.jl

View check run for this annotation

Codecov / codecov/patch

src/makielayout/lineaxis.jl#L631

Added line #L631 was not covered by tests
thomvet marked this conversation as resolved.
Show resolved Hide resolved

# function get_tickvalues(l::LogitTicks, vmin, vmax)
# ticks_scaled = get_tickvalues(l.linear_ticks, identity, logit_10(vmin), logit_10(vmax))
Expand Down
5 changes: 5 additions & 0 deletions test/makielayout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ end
@test get_ticks(numbers, func, xs -> string.(xs) .* "kg", 0, 5) == (numbers, ["1.0kg", "1.5kg", "2.0kg"])

@test get_ticks(WilkinsonTicks(5), identity, automatic, 1, 5) == ([1, 2, 3, 4, 5], ["1", "2", "3", "4", "5"])

#Check that ticks outside supplied limits are filtered out
ticks = [-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
limits = (0.0, 0.6)
@test get_ticks(ticks, identity, automatic, limits...) == ([0.0, 0.2, 0.4, 0.6], ["0.0", "0.2", "0.4", "0.6"])
end
end

Expand Down
Loading