ChipUSM / usm-vlsi-tools

Docker image for vlsi work
Apache License 2.0
1 stars 0 forks source link

Matplotlib doesn't work #6

Open akiles-esta-usado opened 5 days ago

akiles-esta-usado commented 5 days ago
$ python
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> x=[1, 2, 3]
>>> y=[1,2,3]
>>> plt.plot(x,y)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py", line 3794, in plot
    return gca().plot(
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py", line 2742, in gca
    return gcf().gca()
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py", line 1093, in gcf
    return figure()
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py", line 1027, in figure
    manager = new_figure_manager(
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py", line 550, in new_figure_manager
    return _get_backend_mod().new_figure_manager(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/backend_bases.py", line 3507, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/backend_bases.py", line 3512, in new_figure_manager_given_figure
    return cls.FigureCanvas.new_manager(figure, num)
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/backend_bases.py", line 1797, in new_manager
    return cls.manager_class.create_with_canvas(cls, figure, num)
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/backend_bases.py", line 2681, in create_with_canvas
    return cls(canvas_class(figure), num)
  File "/usr/local/lib/python3.10/dist-packages/matplotlib/backends/_backend_gtk.py", line 148, in __init__
    self.window.set_icon_from_file(
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Couldn’t recognize the image file format for file “/usr/local/lib/python3.10/dist-packages/matplotlib/mpl-data/images/matplotlib.svg” (3)
akiles-esta-usado commented 5 days ago

The problem happens because gdk-pixbuf doesn't recognize svg files, or something like that.

It requires installing some packages.

sudo apt install librsvg2-2 librsvg2-common