Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ianhi opened this issue Feb 23, 2023 · 4 comments
Closed

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

ianhi opened this issue Feb 23, 2023 · 4 comments

Comments

@ianhi
Copy link
Contributor

ianhi commented Feb 23, 2023

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

@ianhi
Copy link
Contributor Author

ianhi commented Mar 7, 2023

quick bump of this - I'm pretty sure this should be considered a bug but would love to hear from someone else

@jklymak
Copy link
Member

jklymak commented Mar 7, 2023

Are you locking your freetype between the two tests? We have a lot of image tests like this that would have broken if this were a change in Matplotlib.

@tacaswell
Copy link
Member

If installing from the wheels we should have pinned freetype.

@QuLogic
Copy link
Member

QuLogic commented Mar 8, 2023

AFAICT, ipympl tests install matplotlib from conda-forge. This is built against conda-forge's FreeType and thus text rendering is dependent on which one conda-forge has.

If you want a fixed version, then you need to install our wheels, or install from the conda-forge/label/testing label, like we do in Cartopy https://github.com/SciTools/cartopy/blob/main/environment.yml#L18

@QuLogic QuLogic closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants