Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tick labels containing the digit "1" slightly misaligned in some plot exports #6847

Closed as not planned
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actiontopic: text
@jotasi

Description

@jotasi

Hi,

Hopefully, my issue is not too unimportant and this is the right place to ask about it.
I experienced a minor problem, when using theplt.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, namely0.1 and1.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 the1.0 label of one plot and the0.0 label of the other are really next to each other, the labels look off.

As a minimal working example you can run:

import matplotlibimport matplotlib.pyplot as pltplt.rcParams["font.family"] = "serif"fig, ax = plt.subplots(1, 1)plt.savefig("minimalExample.png", dpi=300)

and then zoom in onto0.8 and1.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:

minimalexamplezoom

minimalexampletwoplots

I tried this on a Linux machine withpython version2.7.9 andmatplotlib versions1.4.2 installed fromdebian repositories and1.5.1 installed viapip.
Generally, this is not a big problem, though, as one can use alternate formats likepdf oreps 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).

Best (and thanks for this great package),

Jonathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actiontopic: text

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp