Skip to content

[Bug]: subplot parameter window appearing 1/4 size on macosx #21648

Closed

Description

@dstansby

Bug summary

On the macosx backend, the subplot adjustment window is appearing 1/4 sized for me:
Screenshot 2021-11-16 at 10 33 33

I'm using a retina display at (2560 × 1600) resolution.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
plt.show()

Actual outcome

Compressed interactive widgets.

Expected outcome

Widgets fill full window.

Additional information

No response

Operating system

macOS Big Sur (11.6)

Matplotlib Version

matplotlib-3.5.0.dev2555+g4a44cb277e

Matplotlib Backend

macosx

Python version

3.9.7

Jupyter version

No response

Installation

git checkout

Activity

  1. dstansby commented on Nov 16, 2021

    @dstansby
    MemberAuthor

    Bisects to ab61cbe from #21365 (ping @QuLogic)

  2. anntzer commented on Nov 16, 2021

    @anntzer
    Contributor

    I don't have a mac to try, but does replacing the entire body of configure_subplot() in _macosx.m by something like (untested, may be missing a semicolon or have some typos)

    -(void)configure_subplots:(id)sender
    {
        PyGILState_STATE gstate = PyGILState_Ensure();
        PyObject *mod = NULL, *base_class = NULL, *ret = NULL;
        if (!(mod = PyImport_ImportModule("matplotlib.backend_bases"))
            || !(base_class = PyObject_GetAttrString(mod, "NavigationToolbar2"))
            || !(ret = PyObject_CallMethod(base_class, "configure_subplots", toolbar))) {
            PyErr_Print();
        }
        Py_XDECREF(mod);
        Py_XDECREF(base_class);
        Py_XDECREF(ret);
        PyGILState_Release(gstate);
    }

    work? (effectively making it inherit the base class implementation, which is after all good enough for most other backends).

  3. added this to the v3.5.1 milestone on Nov 16, 2021
  4. added a commit that references this issue on Nov 18, 2021
    f6495e1
  5. QuLogic commented on Nov 18, 2021

    @QuLogic
    Member

    That seems to work, though I also parented the window so that it closes properly, and is slightly more linked to the plot window. I don't know if it fixes retina displays though.

  6. added 3 commits that reference this issue on Nov 19, 2021
    4896d83
    d1017e0
    b4392d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions