Skip to content

Commit

Permalink
Migrate to matplotlib 3
Browse files Browse the repository at this point in the history
  • Loading branch information
g-braeunlich committed Feb 28, 2023
1 parent c05de9c commit 9393c15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions kivy_garden/matplotlib/backend_kivy.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ class Show(ShowBase):
'''mainloop needs to be overwritten to define the show() behavior for kivy
framework.
'''
def mainloop(self):
@classmethod
def mainloop(cls):
app = App.get_running_app()
if app is None:
app = MPLKivyApp(figure=my_canvas, toolbar=toolbar)
Expand Down Expand Up @@ -401,7 +402,7 @@ def __init__(self, widget):
self.dpi = widget.figure.dpi
self._markers = {}
# Can be enhanced by using TextToPath matplotlib, textpath.py
self.mathtext_parser = MathTextParser("Bitmap")
self.mathtext_parser = MathTextParser("path")
self.list_goraud_triangles = []
self.clip_rectangles = []
self.labels_inside_plot = []
Expand Down
3 changes: 2 additions & 1 deletion kivy_garden/matplotlib/backend_kivyagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class Show(ShowBase):
'''mainloop needs to be overwritten to define the show() behavior for kivy
framework.
'''
def mainloop(self):
@classmethod
def mainloop(cls):
global my_canvas
global toolbar
app = App.get_running_app()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3",
]

dependencies = ["matplotlib"]
dependencies = ["matplotlib >= 3.0.0"]

[tool.setuptools]
packages = ["kivy_garden.matplotlib"]

0 comments on commit 9393c15

Please sign in to comment.