kivy-garden / garden.matplotlib

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

'FigureCanvasKivyAgg' object has no attribute 'resize_event' #82

Closed Patricklevyy closed 1 year ago

Patricklevyy commented 1 year ago

Hello. I'm new to matplotlib and kivy and I have an error like :

AttributeError: 'FigureCanvasKivyAgg' object has no attribute 'resize_event'.

I've tried to fix it but I can't find the solution. If necessary, here's the code below:

      class MatplotlibApp(App):
          def build(self):
              layout = BoxLayout(orientation='vertical')
              self.fig, self.ax = plt.subplots()
              self.ax.plot([1, 2, 3, 4, 5], [2, 3, 4, 3, 2])
              self.canvas = FigureCanvasKivyAgg(figure=self.fig)
              layout.add_widget(self.canvas)

              self.canvas.bind(on_size_changed=self.on_size_changed)

              return layout

          def on_size_changed(self, instance, width, height):
              self.fig.canvas.resize(width, height)`

And i'm on windows with:

matplotlib==3.8.0
Kivy==2.2.1
kivy-deps.angle==0.3.3
kivy-deps.glew==0.3.1
kivy-deps.sdl2==0.6.0
Kivy-examples==2.2.1
Kivy-Garden==0.1.5
kivy-garden.graph==0.4.0
kivymd==1.1.1
tcaduser commented 1 year ago

Hello, I filed a similar Issue. Please see: https://github.com/kivy-garden/matplotlib/issues/1

which is the future home of the garden flower.

Patricklevyy commented 1 year ago

Thank you so much!

misl6 commented 1 year ago

Closed as project moved to kivy-garden/matplotlib