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

Let some kwargs vary with k_ideal in WilkinsonTicks #2892

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

asinghvi17
Copy link
Member

@asinghvi17 asinghvi17 commented Apr 23, 2023

Description

Specifically, k_min = min(2, round(Int, k_ideal * .7)), k_max = min(2, round(Int, k_ideal * 1.3)). Users can still override this as necessary.

Type of change

Arguably a bug fix in the UX for WilkinsonTicks.

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.
    cc @Datseris

Specifically, `k_min = k_ideal - 4`, `k_max = k_ideal + 4`.  Users can still override this as necessary.
@asinghvi17 asinghvi17 linked an issue Apr 23, 2023 that may be closed by this pull request
@jkrumbiegel
Copy link
Member

With -4 you could go to 1, 0, or even negative, all of which are bad. Maybe a better heuristic would be +- 30% or so, with an absolute minimum of 2 because only then can you even tell what the limits are.

So max(2, round(Int, k_ideal * 0.7)) e.g.

Co-authored-by: Julius Krumbiegel < julius.krumbiegel@gmail.com>
@MakieBot
Copy link
Collaborator

MakieBot commented Apr 23, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 3.48s (3.41, 3.55) 0.05+- 176.34ms (166.97, 193.31) 9.41+- 490.44ms (477.02, 504.49) 9.26+- 6.85ms (6.71, 7.11) 0.13+- 26.31ms (26.08, 26.59) 0.20+-
master 3.46s (3.38, 3.54) 0.05+- 170.91ms (165.98, 184.56) 6.55+- 485.84ms (475.60, 508.69) 11.48+- 7.67ms (7.51, 8.05) 0.20+- 26.17ms (25.87, 26.45) 0.20+-
evaluation 1.00x invariant, 0.02s (0.33d, 0.55p, 0.05std) 0.97x invariant, 5.43ms (0.67d, 0.24p, 7.98std) 0.99x invariant, 4.61ms (0.44d, 0.43p, 10.37std) 1.12x faster✅, -0.81ms (-4.86d, 0.00p, 0.16std) 0.99x invariant, 0.15ms (0.73d, 0.20p, 0.20std)
CairoMakie 3.24s (3.17, 3.44) 0.09+- 190.86ms (175.67, 218.39) 14.30+- 113.97ms (108.70, 122.64) 5.64+- 7.55ms (7.22, 7.79) 0.23+- 906.79μs (899.07, 916.18) 7.20+-
master 3.24s (3.16, 3.30) 0.05+- 189.16ms (183.48, 197.56) 5.67+- 113.25ms (108.51, 119.74) 4.44+- 8.28ms (7.95, 8.57) 0.22+- 911.78μs (900.29, 924.59) 8.55+-
evaluation 1.00x invariant, 0.0s (0.02d, 0.97p, 0.07std) 0.99x invariant, 1.7ms (0.16d, 0.78p, 9.98std) 0.99x invariant, 0.72ms (0.14d, 0.79p, 5.04std) 1.10x faster✅, -0.74ms (-3.28d, 0.00p, 0.22std) 1.01x invariant, -5.0μs (-0.63d, 0.26p, 7.87std)
WGLMakie 3.61s (3.55, 3.71) 0.06+- 382.04ms (372.33, 412.05) 14.43+- 8.60s (8.39, 8.98) 0.22+- 8.47ms (8.26, 9.15) 0.31+- 68.86ms (67.48, 69.34) 0.67+-
master 3.62s (3.56, 3.68) 0.05+- 351.62ms (166.62, 390.01) 81.76+- 8.63s (8.46, 9.03) 0.20+- 9.48ms (9.13, 9.74) 0.24+- 69.80ms (67.50, 77.78) 3.58+-
evaluation 1.00x invariant, -0.01s (-0.21d, 0.70p, 0.06std) 0.92x noisy🤷‍♀️, 30.42ms (0.52d, 0.37p, 48.09std) 1.00x invariant, -0.03s (-0.16d, 0.77p, 0.21std) 1.12x faster✅, -1.01ms (-3.63d, 0.00p, 0.28std) 1.01x invariant, -0.95ms (-0.37d, 0.51p, 2.13std)

@Datseris
Copy link
Contributor

Thanks!

@SimonDanisch
Copy link
Member

@jkrumbiegel can we make this mergeable? I think it would be nice to have it easier to construct the WilkinsonTicks

@asinghvi17 asinghvi17 marked this pull request as ready for review February 7, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs discussion/help
Development

Successfully merging this pull request may close these issues.

[BUG] WilkinsonTicks reduces ticks to 2 no matter what
5 participants