Skip to content

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

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

Closed
dstansby opened this issue Nov 16, 2021 · 3 comments · Fixed by #21663
Closed

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

dstansby opened this issue Nov 16, 2021 · 3 comments · Fixed by #21663
Milestone

Comments

@dstansby
Copy link
Member

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

@dstansby
Copy link
Member Author

Bisects to ab61cbe from #21365 (ping @QuLogic)

@anntzer
Copy link
Contributor

anntzer commented Nov 16, 2021

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).

@dstansby dstansby added this to the v3.5.1 milestone Nov 16, 2021
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Nov 18, 2021
@QuLogic
Copy link
Member

QuLogic commented Nov 18, 2021

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.

QuLogic added a commit to QuLogic/matplotlib that referenced this issue Nov 19, 2021
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Nov 19, 2021
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants