-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Various ticks fixes (precision, log scale) #124
Conversation
@BeastyBlacksmith, can you disable the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I feel like this algorithm could try harder to show more than two ticks on log scales, but overall this is already an imrpovement
Looks like this messed up Makie's ticks in some cases. With v1.0.15: ticks = PlotUtils.optimize_ticks(0.25314125f0, 0.94421935f0, k_min = 4, k_max = 8)[1]
# [0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9]
Showoff.showoff(ticks, :plain)
# ["0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9"] With v1.1.0: ticks = PlotUtils.optimize_ticks(0.25314125f0, 0.94421935f0, k_min = 4, k_max = 8)[1]
# Float32[0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.90000004]
Showoff.showoff(ticks, :plain)
# ["0.30000001", "0.40000001", "0.50000000", "0.60000002", "0.69999999", "0.80000001", "0.90000004"] |
Ha, thanks for reporting, not surprising, will fix. EDIT: Actually @ffreyer I'd expect |
I'd expect that too. Maybe this should be fixed in Showoff or Makie? |
I'm not familiar with $ grep -r optimize_ticks
src/basic_recipes/axis.jl: scaled_ticks, mini, maxi = optimize_ticks(
src/basic_recipes/axis.jl: scaled_ticks, mini, maxi = optimize_ticks(
src/makielayout/ticklocators/wilkinson.jl: tickvalues, _ = PlotUtils.optimize_ticks(vmin, vmax; , only 3 occurrences in |
Seems like I introduced type instability in this PR, fix is underway ... |
1.6
and latest1.7
(following test on 1.6 also Plots.jl#3966).1.6
for consistency withPlots
.Plots
.Xref: JuliaPlots/Plots.jl#3790, JuliaPlots/Plots.jl#3577, JuliaPlots/Plots.jl#3921.
Ran
Plots.jl
test suite without any apparent issue.