Skip to content

doesn't work with current libsixel #2

@xiangpeng2008

Description

@xiangpeng2008

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions