kivy-garden / garden.matplotlib

Matplotlib backends using kivy
MIT License
103 stars 50 forks source link

Cannot Run Examples #10

Closed SecurityBird closed 9 years ago

SecurityBird commented 9 years ago

Hi there,

I'm having trouble running the example code. I am using python 2.7, kivy 1.9.0, and matlab 1.4.3 on Ubuntu . I get a similar error when using python 3.4. I used the Kivy Garden tool to setup the garden.matplotlib add-on.

The following terminal dump is from running "test_backend.py". I get similar results when running the other two examples in the folder.

Terminal Dump:

[INFO ] [Logger ] Record log in /home/yamhead/.kivy/logs/kivy_15-08-23_59.txt [INFO ] [Kivy ] v1.9.0 [INFO ] [Python ] v2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] [INFO ] [Factory ] 173 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored) [INFO ] [Text ] Provider: sdl2 [INFO ] [OSC ] using for socket [INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored) [INFO ] [GL ] OpenGL version <3.0 Mesa 10.1.3> [INFO ] [GL ] OpenGL vendor [INFO ] [GL ] OpenGL renderer <Mesa DRI Intel(R) Ivybridge Mobile > [INFO ] [GL ] OpenGL parsed version: 3, 0 [INFO ] [GL ] Shading version <1.30> [INFO ] [GL ] Texture max size <8192> [INFO ] [GL ] Texture max units <16> [INFO ] [Window ] auto add sdl2 input provider [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked Traceback (most recent call last): File "main.py", line 65, in fig, ax = plt.subplots() File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 1078, in subplots fig = figure(fig_kw) File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 435, in figure _kwargs) File "/home/yamhead/.kivy/garden/garden.matplotlib/backend_kivy.py", line 375, in new_figure_manager return new_figure_manager_given_figure(num, thisFig) File "/home/yamhead/.kivy/garden/garden.matplotlib/backend_kivy.py", line 381, in new_figure_manager_given_figure canvas = FigureCanvasKivy(figure) File "/home/yamhead/.kivy/garden/garden.matplotlib/backend_kivy.py", line 1009, in init super(FigureCanvasKivy, self).init(figure=self.figure, _kwargs) File "/usr/lib/python2.7/dist-packages/kivy/uix/behaviors.py", line 771, in init super(FocusBehavior, self).init(kwargs) File "/usr/lib/python2.7/dist-packages/kivy/uix/widget.py", line 261, in init super(Widget, self).init(**kwargs) File "_event.pyx", line 249, in kivy._event.EventDispatcher.init (kivy/_event.c:4493) TypeError: init() takes exactly 2 arguments (1 given)

Thanks in advance. I'm really excited that someone has provided matplotlib back end support for kivy. If I could get it to function, it would be an enormous help for my current project. Let me know if I can clarify anything. I will continue to see if I can find a solution.

andnovar commented 9 years ago

Hello,

I am sorry, you would need to use a more recent kivy version, some changes were made to **kwargs when instantiating a Widget that seems you don't have. Try to compile master from github and run the examples again.

SecurityBird commented 9 years ago

Thanks! That fixed the problem.