epfl-lts2 / pygsp

Graph Signal Processing in Python
https://pygsp.rtfd.io
BSD 3-Clause "New" or "Revised" License
483 stars 93 forks source link

Tutorial doesn't work #14

Closed mada-ko closed 7 years ago

mada-ko commented 7 years ago

I downloaded the package using pip and I tried "Introduction to the PyGSP" in tutorials. And I encountered the below error when running the code.

Code: import numpy as np from pygsp import graphs, filters, plotting plotting.BACKEND = 'matplotlib' G = graphs.Logo() G.compute_fourier_basis() print(G.U) G.plot_signal(G.U[:, 1], vertex_size=50)

Error: TypeError: pg_plot_signal() got an unexpected keyword argument 'show_plot'

I use: MacOS Sierra 10.12.6 python 3.6 PyGSP (0.4.1)

mdeff commented 7 years ago

That's because you are following the tutorial of the master version while you've installed version 0.4 with pip.

Please either install the master version with

git clone git@github.com:epfl-lts2/pygsp.git
pip install -e pygsp

Or follow the tutorial for 0.4.

mada-ko commented 7 years ago

Thank you for your reply. I have installed the master version and the tutorials worked. But the graph was not shown by running G.plot() and G.plot_signal(G.U[:, 1], vertex_size=50). When I run the tutorials code, any error was not raised.

mdeff commented 7 years ago

That was because you needed to call plt.show() or use %matplotlib inline in Jupyter notebooks for plots to show up using the matplotlib backend. I've changed that behavior and now plots will show up automatically. Thanks for reporting this!

mada-ko commented 7 years ago

I have resolved the problem by using %matplotlib inline. Thanks for your support.