-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix tutorial pyplot scales (issue #6775) #6779
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
Fix tutorial pyplot scales (issue #6775) #6779
Conversation
Definitively, if I remove the
I don't understand everything, but it looks like |
Looks good. I think the tight_layout issue is something that we should investigate further. Will you create an issue for that so we can merge this without it? |
Fix tutorial pyplot scales close issue #6775
backported to v2.x as e2b1184 |
@jenshnielsen I've just created a dedicated issue (#6789) as you suggested. |
Thanks @afvincent thats great and a very detailed issue :) |
Fix #6775.
The issue reports among other things a poor choice of x-ticks. However, this seems to be OK in the devdocs version (http://matplotlib.org/devdocs/users/pyplot_tutorial.html)
I suppressed the minor y tick labels in the case of the logit scale, to keep only the major ones. To do so, I used a
NullFormatter
: is it OK for a pyplot tutorial? First I wanted to simply useplt.minorticks_off
but it hides the nice feature of the logit scale, which is to be log in some range and linear in another range.Furthermore, I slightly tweaked the
linthreshy
value in the case of the symlog case, to avoid overlapping some of the y tick labels.The current PR should produce things similar to

I precise “similar” because depending on the random samples, the tick range of the axes may be different.
PS: I got weird crashes when trying to use
plt.tight_layout
to adjust the subplots. I'll see if it comes from my machine or is a real issue, and I will open report another issue in the latter case. And for the moment, I have simply defined by hand some correct values inplt.subplots_adjust
.