Skip to content

[Bug]: Rendering on Wayland with fractional scaling looks bad #30218

Open
@cbrnr

Description

@cbrnr

Bug summary

When rendering a plot on Wayland with fractional scaling turned on (e.g., 150%), the resulting plot content looks bad (i.e., jagged edges in lines and text). The UI is fine though (i.e., the toolbar looks nice and sharp).

Code for reproduction

import matplotlib

matplotlib.use("qtagg")

import matplotlib.pyplot as plt

plt.plot([1, 10, -3, 17, 0, -6, 2, 12, 18, -3])
plt.show()

Actual outcome

Image

Expected outcome

I would expect the plot to render nicely.

Additional information

Maybe there is something wrong with detecting the actual DPI when fractional scaling is enabled? I also noticed that when creating the figure with 100% and then switching to 150% scaling in my desktop environment (I'm using GNOME), the figure remains sharp (i.e., plot elements are anti-aliased). It's only when I create the figure from 150% scaling that it is jagged. (I use a 4K screen with 150% fractional scaling.)

Operating system

Arch Linux

Matplotlib Version

3.10.3

Matplotlib Backend

qtagg

Python version

3.13.5

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions