I'll try to solve it by downgrading matplotlib to version 3.7.1, but anyone who installs via apt cannot install an outdated version.