matplotlib-sixel icon indicating copy to clipboard operation
matplotlib-sixel copied to clipboard

doesn't work with current libsixel

Open xiangpeng2008 opened this issue 4 years ago • 0 comments

Hi sir,

It seems this module doesn't work with current libsixel anymore. I tested on iTerm2 which supports sixel.

>>> import matplotlib
>>> matplotlib.use('module://matplotlib-sixel')
>>> from pylab import *
>>> plt.plot(sin(arange(100) / 10))
[<matplotlib.lines.Line2D object at 0x11bc89df0>]
>>> show()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xiangpeng/venv/lib/python3.8/site-packages/matplotlib/pyplot.py", line 353, in show
    return _backend_mod.show(*args, **kwargs)
  File "/Users/xiangpeng/Downloads/matplotlib-sixel/matplotlib-sixel/sixel.py", line 73, in show
    display(figure_manager.canvas.figure)
  File "/Users/xiangpeng/Downloads/matplotlib-sixel/matplotlib-sixel/sixel.py", line 49, in display
    resize_fig(figure)
  File "/Users/xiangpeng/Downloads/matplotlib-sixel/matplotlib-sixel/sixel.py", line 36, in resize_fig
    pixel_factor = pixel_size / xterm_pixels()
  File "/Users/xiangpeng/Downloads/matplotlib-sixel/matplotlib-sixel/xterm.py", line 42, in xterm_pixels
    assert c == '\x1b'
AssertionError
^[[4;1053;2062t>>> ;1053;2062t
  File "<stdin>", line 1
    ;1053;2062t
    ^
SyntaxError: invalid syntax
>>> ;1053;2062t
  File "<stdin>", line 1
    ;1053;2062t
    ^
SyntaxError: invalid syntax

Screenshot 2021-10-02 at 4 43 57 PM

Thanks,

xiangpeng2008 avatar Oct 02 '21 08:10 xiangpeng2008