You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows how to extend FigureCanvasKivyAgg for use in a kv file.
extend4kv.py:
#!/usr/bin/env python3
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
from kivy.app import App
import matplotlib.pyplot as plt
plt.plot([1, 23, 2, 4])
plt.ylabel('some numbers')
# A class in which __init__ has no positional parameters, so it can be used in a kv file:
class MyFigure(FigureCanvasKivyAgg):
def __init__(self, **kwargs):
super().__init__(plt.gcf(), **kwargs)
class Extend4Kv(App):
pass
Extend4Kv().run()
Now use in the file extend4kv.kv:
# kv file
MyFigure:
The text was updated successfully, but these errors were encountered:
escallonia
changed the title
Please add this example: How use in kv file
Please add this example: How to use in kv file
Apr 24, 2020
This example shows how to extend FigureCanvasKivyAgg for use in a kv file.
extend4kv.py:
Now use in the file extend4kv.kv:
The text was updated successfully, but these errors were encountered: