Skip to content

[Bug]: Matplotlib hangs on Spyder run on Mac #27231

Closed

Description

@SRattan16

Bug summary

I have a very basic code on my work computer to create a plot in Spyder using Matplotlib. I am new to Mac OS and installed Spyder through a standalone installer as my organization does not allow Anaconda. I have the most updated versions of Matplotlib, Spyder and Python. On running the code to generate an interactive plot, I see a white window that's frozen and hangs up. I can run Spyder only after I force quit the window.

Also, my backend is set to Automatic (Spyder-->preferences-->IPython console-->Graphics-->Backend-->automatic).
Plot works fine when I set it to inline but the disadvantage there is that it's not interactive.

Code for reproduction

import matplotlib.pyplot as plt

a=[1,2,3,4,5]
b=[1,4,6,8,10]
plt.plot(a,b)
plt.show()

Actual outcome

Screenshot 2023-10-29 at 5 19 49 PM

Expected outcome

I was expecting to create a plot that works fine when I set backend to 'inline'

Additional information

No response

Operating system

Mac OS

Matplotlib Version

3.8.0

Matplotlib Backend

Qt5Agg

Python version

3.9.6

Jupyter version

No response

Installation

pip

Activity

  1. rcomer commented on Nov 1, 2023

    @rcomer
    Member

    Do you see any output in the console when the window hangs? Also what happens if you set the backend to a specific interactive one?

    A colleague of mine recently had a similar problem in pycharm: the traceback showed that it was somehow defaulting to the macos backend, although she was using Linux…

  2. QuLogic commented on Nov 1, 2023

    @QuLogic
    Member

    Are you sure you are using the Qt5Agg backend? That one has the toolbar on the top of the figure and has separators between button groups.

  3. jklymak commented on Nov 1, 2023

    @jklymak
    Member

    #26669 may help in asking people to debug issues like this.

  4. greglucas commented on Apr 16, 2024

    @greglucas
    Contributor

    Closing for lack of response. Feel free to add more information and we can reopen.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions