matrach / matplotlib-terminal

Matplotlib backend to plot in terminal using matrach/img2unicode
MIT License
51 stars 2 forks source link

plt.show() locking error #4

Open cyborgdennett opened 4 weeks ago

cyborgdennett commented 4 weeks ago

Always getting lock error no matter which show I use

>>> plt.show("block")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib/pyplot.py", line 607, in show
    return _get_backend_mod().show(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 128, in show
    manager.canvas.print_terminal(rendering=rendering)
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 109, in print_terminal
    self.draw(rendering=rendering)
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 61, in draw
    with self.renderer.lock:
         ^^^^^^^^^^^^^^^^^^
perrette commented 3 weeks ago

Funny I was just looking up because of the exact same issue. Python 3.11, matplotlib 3.8.4 The exact cause of the error is: AttributeError: 'MyRenderer' object has no attribute 'lock' Very cool project, thanks.