Skip to content

[Bug]: Font difference in Ubuntu for latest matplotlib #25314

@ianhi

Description

@ianhi

Bug summary

The latest matplotlib has slightly different font positioning on Ubuntu than the released 3.7

This was discovered by ipympls tests here: matplotlib/ipympl#514 (comment)

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib import __version__
import numpy as np

x = np.linspace(0,100,1000)
y = np.sin(x)


fig, ax = plt.subplots()
ax.plot(x,y)
plt.savefig(f"{__version__}.png")

Actual outcome

Run first with 3.7.0

and then with nightly wheel
(pip install --upgrade --pre --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple --extra-index-url https://pypi.org/simple matplotlib

This gives two images where the labels of the positive y-ticks are shifted slightly. Here's me toggling between the two generated images:

Peek 2023-02-23 18-33

And here is the diff image from the ipympl tests

ipympl-ipynb-cell-0-diff

Expected outcome

No differences

Additional information

We also run latest tests on macos, and those did not fail, so this seems to be specific to ubuntu.

Operating system

Ubuntu

Matplotlib Version

latest

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

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