-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
savefig re-scales xticks and labels of some (but not all) subplots #20765
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
Comments
Confirmed - it looks like |
Happy to help. I just noticed that the x-axis ticklabels (major) of the lower-right subplot (ax4 in subfig_br) shift when I change the figsize, but keep dpi constant: In this instance the major and minor ticks seem to remain in-phase with one another. I was unable to reproduce this with the test data in my original post. Let me know if you'd like me to upload my full data series. |
Thanks, but this can be replicated with something much simpler... |
In terms of getting my current document sent off, is my best (short-term) bet to bail on subfigs, jump back to gridspec and manually locate pseudo-subxlabels via annotate? |
I'd set the xticks manually for now (or patch matplotlib). I do have a fix for this that I'll submit in a few minutes. |
The x-ticks (and respective labels) for some of my subplot axes are re-scaled in the output png files.
While I didn't find this exact problem posted elsewhere, perhaps it's related to:
#12564
I say that b/c, the above image was my standard export at 300 dpi while I get my expected result at 120 dpi (below):
Changing the figsize changes the expression of the problem, but doesn't make it go away (e.g. 300 dpi at 14 x 20):
I also consulted :
[(https://github.com//issues/6800)]
[(https://github.com//issues/6638)]
but they are different expressions (of possibly a similar underlying problem) than mine.
I find it particularly odd that the minor x-ticks seem to stay put while the major x-ticks (and respective labels) shift.
Minimally reproducible code (with min/maxima of x-values in my data series plotted as points):
Any suggestions for a work-around?
Operating system
Windows 10 Pro
Matplotlib Version
3.4.2
Python version
3.9.5
Jupyter version
3.0.16
Installation
conda
Conda channel
conda-forge
The text was updated successfully, but these errors were encountered: