-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
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
Metadata
Metadata
Assignees
Labels
No labels