Skip to content

API: default locator on colorbars to AutoLocator #6375

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

Merged
merged 1 commit into from
May 9, 2016

Conversation

tacaswell
Copy link
Member

This brings them inline with the default locator on the x and y axis.

Noted in https://stackoverflow.com/questions/37053874/

This brings them inline with the default locator on the x and y axis.

Noted in https://stackoverflow.com/questions/37053874/
@tacaswell tacaswell added this to the 2.0 (style change major release) milestone May 6, 2016
@WeatherGod
Copy link
Member

I think @efiring would probably know best about why the colorbars have the locators they have.

@efiring
Copy link
Member

efiring commented May 6, 2016

I think it is just a quirk of history that colorbar is using the default MaxNLocator instead of AutoLocator, which is just MaxNLocator with different defaults. Switching to AutoLocator will reduce the number of colorbar ticks in most cases where it gets used, because AutoLocator has a smaller set of "nice" numbers, and has the recently-added 'auto' ability to adjust the number based on the axis length. In cases where the _ticker logic chooses FixedLocator, this 'auto' feature is absent and the target nbins remains 10. Similarly, LogLocator has no 'auto' feature.

@efiring efiring merged commit f82fc3b into matplotlib:v2.x May 9, 2016
@tacaswell tacaswell deleted the api_cb_default_locator branch May 9, 2016 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants