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

Errors when plotting the doctest examples #17

Closed dsacc closed 6 years ago

dsacc commented 6 years ago

Many doctest examples try to plot passing an 'ax' argument. However by default pygsp.plotting sets: BACKEND = 'pyqtgraph' So I often get: TypeError: _qtg_plot_signal() got an unexpected keyword argument 'ax' The problem is that it takes the following arguments: _qtg_plot_signal(G, signal, show_edges, plot_name, vertex_size, limits) Making the matplotlib backend explicit in the calls could help improve the docs. Another solution is to switch backend automatically when an 'ax' parameter is provided.

mdeff commented 6 years ago

Thanks for helping improving the docs. :)

The solution is to change the default backend with plotting.BACKEND = 'matplotlib'. That was done automagically before each example. I wanted to avoid writing backend='matplotlib' explicitly every time as it's quite verbose.

Anyway, I changed the default backend for the next release (should be out today :) to be matplotlib in 730b4f0. As most people work in notebooks, it makes more sense to plot with it by default. (pyqtgraph is also harder to install.) Interactive exploration can still be done with pyqtgraph with either plotting.BACKEND = 'pyqtgraph' or passing backend='pyqtgraph'.

dsacc commented 6 years ago

Perfect :+1:

mdeff commented 6 years ago

Release done :-)