[Bug]: Figure size change on macos in matplotlib 3.11.0 macosx backend · Issue #31936 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: Figure size change on macos in matplotlib 3.11.0 macosx backend #31936

Description

@mironleon

Bug summary

Two ways of generating a matplotlib plot in our package started producing images with slightly different dimensions since the 3.11.0 release, using the macosx backend. Switching to the agg backend makes the problem disappear.

I know I can't provide an actual MWE since I don't own a mac device, but maybe someone has an idea what is happening based on the diff image?

Code for reproduction

N/A

Actual outcome

Image Image Image

Expected outcome

We expect the two images to be the same.

Additional information

Since the 3.11 release, the CI pipelines for our scientific python package have been failing for the macos builds only. Our testsuite fails on some image comparison tests, that checks if two different ways to create a plot result in the same outcome. These tests used to pass for a long time, across multiple matplotlib versions. They still pass in our linux pipelines. But after the 3.11 release, they started failing on macos, because the vertical image dimensions differ by 2 pixels. I also compared the resulting images and there are also tiny differences in the rendering.

You can see the output log here at the bottom: https://gitlab.com/ifosim/finesse/finesse3/-/jobs/14970136713

Operating system

OS/X

Matplotlib Version

3.11.0

Matplotlib Backend

macosx

Python version

3.11 till 3.14

Jupyter version

No response

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions