Skip to content

FIX: minimum number of bins in 'auto' is 3 - #6470

Closed
tacaswell wants to merge 1 commit into
matplotlib:masterfrom
tacaswell:enh_min_number_ticks
Closed

tacaswell wants to merge 1 commit into
matplotlib:masterfrom
tacaswell:enh_min_number_ticks

Conversation

@tacaswell

Copy link
Copy Markdown
Member

This is to prevent plots with only one visible tick.

Use 3 instead of 2 because ticks may fall out of the visible range so 2
bins would be 3 ticks which may be one visible and 2 off either end.

closes #5784

This is to prevent plots with only one visible tick.

Use 3 instead of 2 because ticks may fall out of the visible range so 2
bins would be 3 ticks which may be one visible and 2 off either end.
@tacaswell tacaswell added this to the 2.0 (style change major release) milestone May 23, 2016
@tacaswell tacaswell added the API: default changes Changes to default behavior label May 23, 2016
@efiring

efiring commented May 23, 2016

Copy link
Copy Markdown
Member

This doesn't do the job because nbins is just a maximum; there is nothing in place to enforce a minimum. The locator is still stuck trying to shoehorn in as many ticks as it can, up to the max, given all the other constraints.

If we want MaxNLocator to serve as a Max_and_Min_NLocator then we will need to add some sort of fallback logic: if the normal route yields fewer than the minimum number of ticks, back off on a constraint (such as the max) and try again, until the minimum is obtained.

@tacaswell

Copy link
Copy Markdown
Member Author

Your right. It might make it less likely to do the wrong thing, will not guarantee it will always do the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: default changes Changes to default behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamic ticking (#5588) should avoid (if possible) single ticks

2 participants