kivy-garden / garden.matplotlib

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

tst_plt.py doesn't work for me #59

Closed victorclaessen closed 6 years ago

victorclaessen commented 6 years ago

Hi,

I can't get the ''tst_plt.py'' example to work. Log below:

root@kivy:/home/victor/garden# python tst_plt.py
[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_18-09-26_24.txt
[INFO   ] [Kivy        ] v1.11.0.dev0, git-f679b7b, 20180926
[INFO   ] [Python      ] v2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516]
[INFO   ] [Factory     ] 195 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [Window      ] Provider: pygame(['window_egl_rpi'] ignored)
[WARNING] [WinPygame   ] Video: failed (multisamples=2)
[WARNING] [WinPygame   ] trying without antialiasing
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <gl>
[INFO   ] [GL          ] OpenGL version <3.0 Mesa 13.0.6>
[INFO   ] [GL          ] OpenGL vendor <VMware, Inc.>
[INFO   ] [GL          ] OpenGL renderer <Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <1.30>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [GL          ] NPOT texture support is available
 /root/.kivy/garden/garden.matplotlib/backend_kivy.py:669: MatplotlibDeprecationWarning: The weight_as_number function was deprecated in version 2.1.
   if weight_as_number(prop.get_weight()) > 500:
 Traceback (most recent call last):
   File "tst_plt.py", line 100, in <module>
     plt.show()
   File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 253, in show
     return _show(*args, **kw)
   File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 240, in __call__
     return self.show(block=block)
   File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 208, in show
     cls.mainloop()
 TypeError: unbound method mainloop() must be called with Show instance as first argument (got nothing instead)
mcu101 commented 6 years ago

Hi Victor, have you tried running the examples with matplotlib 2.0.0? The Kivy Garden matplotlib integration is currently not compatible with matplotlib versions 2.1 to the latest 3.0.0 because backend_kivy.py calls weight_as_number() which was deprecated in matplotlib 2.1.

Try running the examples on a virtual environment with matplotlib 2.0.0. You can install it by running:

python -m pip install -U --force-reinstall matplotlib==2.0.0

victorclaessen commented 6 years ago

That worked. Thanks!

Just out of curiosity: is that the weight_as_number() deprecation the only thing preventing the use of newer versions of matplotlib? Is that hard to fix?

matham commented 6 years ago

The weight thing has already been fixed. Give master a try and let us know (with a new issue) if it's still broken.