Python Matplotlib: "pyplot.show( )" freezes forever

Problem description:
Trying to plot anything with matplotlib’s “pyplot”. As per Replit docs, pyplot.show() is the way to get the output graph to appear. This happens, but thereafter Replit is forever stuck in “Run” mode.

Example extremely simple code that freezes:

Expected behavior:
The code should finish running as the plot is displayed in the “Output” tab.

Actual behavior:
The code is stuck forever on “plt.show()” line.

Browser/OS/Device:
Tested on both Chrome and Safari

Works fine for me:
https://replit.com/@MiloCat/PyPlot-Example#
Try deleting your repl and making a new one.

2 Likes

This does not solve the issue, unfortunately.
I created multiple replits in different accounts, as well as forked the recommended Docs → matplotlib’s replit

  • behaviour (freezing) happens in every case
1 Like

@lawrencegithub Hi there! You can try entering kill 1 into the Shell.

2 Likes

Unfortunately this does not solve the issue.
Any idea what might be causing it? Is anybody else experiencing this bug?

1 Like

I can live with saving a fig instead every time and viewing in separate window;
just killing me that I can’t figure out what’s going on

1 Like

When it gets stuck running, try calling pkill ld in the Shell, that should kill the process running the program.

2 Likes