-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Introduce max_auto_ticklabel_spacing!
for less jitter
#4607
base: master
Are you sure you want to change the base?
Conversation
Benchmark ResultsSHA: 250e9e0ec37bf05a4b82adc7c982666cc699bc8a Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
I'm not sure how much is gained here vs just doing |
Well, as pointed out, the "exact" version is not really exact once you start zooming.
I guess we could use more attributes from the ticklabels, but replacing the text with n_chars? |
I didn't mean that it was useful for zooming specifically, just that it's purpose is an exact one (you wouldn't be able to pick the value it chooses for The How about a mode like |
That's not a bad idea :) |
Ok, I reverted most of my changes to |
max_auto_ticklabel_spacing!
for less jitter
To not have jitter in the axis when panning/zooming, we've been recommending to use
tight_ticklabel_spacing!
, which doesn't fully work to avoid jitter.n_tick_chars=automatic
totight_xticklabel_spacing!
whereautomatic
replicated the old behavior. With set to e.g. 5, it will allocate enough space for 5 chars of ticks, e.g. "0.001".timed_ticklabelspace_reset
to reset the tickspace less often when zooming around. But it also resets the tickspace back to automatic (this may be a bug?). In any case, when we want truly static ticks, this should not run at all/ To achieve this, I added a a new option to turn of the timed reset totight_ticklabel_spacing!
andAxis
.Open question: maybe this should be put in a new function, e.g.
static_tickspace!(ax, nchars)
?cc: @jkrumbiegel