-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add new "proportional" tick mode #6824
Comments
@ayjayt thanks for the issue and related PR. Just to make sure I understand your goals here: Our automatic ticks try to give nice round numbers, but the cost of doing that, in general, is that you won't have ticks exactly at the ends of the axis range. What you're proposing here, putting ticks at precise fractions of the axis length, does show the axis range exactly (at least if you include 0 and 1 in the list) at the expense of round values. I'll note that we have the same tradeoff with Another way to accomplish a subset of the functionality you're proposing but with a more concise API would be to continue using That feels to me like it would cover most of the uses for this feature, do you ever foresee wanting to use this with tickvals that are either (a) not evenly spaced or (b) not spanning exactly 0 to 1? We could of course start with one of these and then add the other later, but if nearly everyone will use the simpler one we should start there. Re: naming - to me the key here is that (in the variant I'm proposing) the ticks span the whole domain, so maybe we just say that: |
Yeah, that's it. Some contexts:
I'm totally fine w/ changing the name. The nice thing about the |
OK great. I suspect if the goal is feature parity, these ticks will always be evenly spaced, ie what I'm proposing as In that case the implementation can be even simpler than you're suggesting: generate Please note a few extra situations we'll want to pay attention to:
|
Sounds good, will try and get it done post haste. |
a pull request with the feature, but with my original Otherwise next week after I have some response on parameterization and on The majority of work here was in testing (it allowed me to find the duplicate-tick bug we patched) and downgrading my ES6 to ES5, actual implementation easy-peazy . Video demo of current implementation of |
proportional
What
Add a new tick mode:
Effect:
Plotly will make ticks propotional to the range: So if the x range is
[50, 150]
, the tick marks will appear at 50, 100, and 150. If the xrange is[-0.5, 1.5]
, the tick marks will appear at -0.5, 0.5, and 1.5.Why
Auto
tick formatting is usually ugly (for any valuentick
), and the other modes aren't responsive to user zooms.Workaround: Using python w/ jlab, but I can calculate ticks manually on range changes and during rendering, and then use
array
mode, but it is clunky, and requires my users to have the plotly installed in their kernel and on jlab server. My proposal doesn't seem that different than modifyingauto
behavior, so I'll take a shot.Who am I
Working on analysis software for geologists who design wells.
The text was updated successfully, but these errors were encountered: