-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ticks based on number of subplots #776
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
Conversation
# scale # of ticks to be based on size how many rows we have | ||
nbins = max(2, 7 - int(nrows)) | ||
#nbins = max(2, int(10/ nrows)) | ||
print(nbins, "y") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you left a print in here
Hey Paul, This is a very useful PR, because the too many ticks problem is a common annoyance. I think "subplots" is the perfect place to add enhancements like these because a) it knows the whole geometry and b) it is still somewhat lightly used and so less likely to change/break people's existing code. I would like to do more: in particular, I think we should expose a tight_layout=True kwarg to subplots so that tight layout is on by default (but configurable), Can you add this to the PR? |
We don't need to adjust every locator when either x- or y-axis is shared across all of the subplots.
Hi John, I removed the print statements, and adjusted the logic for sharex and sharey, since locators get reused in that case. as for |
Yes, tight_layout is a one-time action. Although we may implement some automatic use, see #774. |
Hey Paul, just wanted to point out that we are in the thick handling the v1.1.x release right now so are in a holding pattern on master PRs, but I am definitely interested in this so make sure to ping us if we fall quite on this PR after we get 1.1.1 out. JDH |
@ivanov : I think we can start looking at this again now that (for the most part) v1.2.0 is out of the way. Would you be willing to rebase this, and add appropriate tests and we can get this PR back on the agenda. Cheers, |
@ivanov is that a no, or a "I'm on it"? 😄 |
both :) I took a stab and there were too many conflicts immediately, and I didn't |
here's an implementation of adjusting the tick locator depending on how many subplots there are. I implemented this at PyData a few weeks back, but forgot to submit the PR.
to see the goodies of this PR, use this in the ipython notebook
(I'll rebase this if this won't merge cleanly)