Fix tutorial pyplot scales (issue #6775)#6779
Merged
tacaswell merged 2 commits intomatplotlib:masterfrom Jul 18, 2016
Merged
Conversation
Contributor
Author
|
Definitively, if I remove the I don't understand everything, but it looks like |
Member
|
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? |
tacaswell
added a commit
that referenced
this pull request
Jul 18, 2016
Fix tutorial pyplot scales close issue #6775
Member
|
backported to v2.x as e2b1184 |
4 tasks
Contributor
Author
|
@jenshnielsen I've just created a dedicated issue (#6789) as you suggested. |
Member
|
Thanks @afvincent thats great and a very detailed issue :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_offbut 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
linthreshyvalue 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_layoutto 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.