Hopefully, my issue is not too unimportant and this is the right place to ask about it.
I experienced a minor problem, when using the plt.savefig function to save my plots to either .png (and also for .jpg) with a high resolution (300 dpi). If I specified to not use the standard font but set a font family to serif (plt.rcParams["font.family"] = "serif") all x-axis labels containing the digit "1", that I tried, namely 0.1 and 1.0 are misaligned in y-direction by 1 pixel. It's not noticeable most of the time, but when one has two subplots next to each other and the 1.0 label of one plot and the 0.0 label of the other are really next to each other, the labels look off.
and then zoom in onto 0.8 and 1.0. You can see the difference best, when you compare the decimal points.
Here is also a picture of the zoom and one of the two subplots, where I saw the problem first:
I tried this on a Linux machine with python version 2.7.9 and matplotlib versions 1.4.2 installed from debian repositories and 1.5.1 installed via pip.
Generally, this is not a big problem, though, as one can use alternate formats like pdf or eps if one really cares about a one pixel misalignment. Nonetheless, I thought, I might let you know. Feel free to close/delete this issue, if you consider it as too unimportant (or if this is the wrong place to raise it, as it might just be an external libraries fault).
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
This is still an issue and appears to be font dependent.
with dejavu serif (using "serif" just means "find font in this list", on my system the one it picks in dejavu):
with dejavu sans:
Speculation on what could be going on here:
inherent issues with pixel snapping
we are doing something wrong computing the bounding boxes
font metrics in the font could be wonky / wrong
the '1' is just a pixel bigger
It should also be noted that the x-axis ticks have vertical alignment of "top" so if the bounding boxes are varying at all I would expect the offsets to appear at the bottom.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
github-actions commented on Mar 27, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
tacaswell commented on Mar 27, 2023
This is still an issue and appears to be font dependent.
with dejavu serif (using "serif" just means "find font in this list", on my system the one it picks in dejavu):
with dejavu sans:
Speculation on what could be going on here:
It should also be noted that the x-axis ticks have vertical alignment of "top" so if the bounding boxes are varying at all I would expect the offsets to appear at the bottom.
github-actions commented on Apr 1, 2024
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!