WebSafe 3.7github.com
|
|
🏠
Skip to content

[BUG]: plt.show() window too small with screen scaling and TkAgg backend #31177

@SuperCowProducts

Description

@SuperCowProducts

NB I have found a workaround for this, see below

Summary

This graph

import numpy as np
import matplotlib.pyplot as plt

X = np.linspace(0, 10*np.pi, 1000)
Y = np.sin(X)

fig, ax = plt.subplots()
ax.plot(X, Y)

plt.show()

displays as

Image

Now clearly the axis labels and everything inside the matplotlib window is not being scaled like the rest of the OS, which makes the numbers etc. very hard to read!

Any ideas?
What strategies can I use to debug the issue?

Proposed fix

yalihupokn@zoqu-endiman:~/Nextcloud/mp$ uname -a
Linux zoqu-endiman 6.18.10-402.asahi.fc42.aarch64+16k #1 SMP PREEMPT_DYNAMIC Sat Feb 14 20:56:50 UTC 2026 aarch64 GNU/Linux
yalihupokn@zoqu-endiman:~/Nextcloud/mp$ cat /etc/os-release 
NAME="Fedora Linux Asahi Remix"
VERSION="42 (Forty Two [Adams])"
RELEASE_TYPE=stable
ID=fedora-asahi-remix
ID_LIKE=fedora
VERSION_ID=42
VERSION_CODENAME="adams"
PRETTY_NAME="Fedora Linux Asahi Remix 42 (Forty Two [Adams])"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora-asahi-remix:42"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedora-asahi-remix.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-asahi-remix/"
SUPPORT_URL="https://discussion.fedoraproject.org/c/neighbors/asahi/asahi-help/94"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=42
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=42
VARIANT="KDE Plasma Desktop Edition"
VARIANT_ID=kde
yalihupokn@zoqu-endiman:~/Nextcloud/mp$ 

[UPDATE]

strace -e trace=openat ./t.py &> log.txt

log.txt

Workaround

[UPDATE 2]

Fixed it 🎉 (Documentation reference: https://matplotlib.org/stable/Matplotlib.pdf#page=1930)

Steps to reproduce
. /home/yalihupokn/venv-for-matplotlib/.venv/bin/activate
uv pip install pyqt6 pyside6

Added line matplotlib.use('QtAgg') before plt.show()

Final result
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions