Skip to content

Commit 0635dc2

Browse files
committed
added some documentation
1 parent 92ef944 commit 0635dc2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pygame_matplotlib/backend_pygame.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@
1818
from matplotlib.figure import Figure
1919
from matplotlib.path import Path
2020

21+
2122
class FigureSurface(pygame.Surface, Figure):
23+
"""Hybrid object mixing pygame.Surface and matplotlib.Figure.
24+
25+
The functionality of both objects is kept with some special features
26+
that help handling the figures in pygame.
27+
"""
28+
2229
def __init__(self, *args, **kwargs):
30+
"""Create a FigureSurface object.
31+
32+
Signature is the same as matplotlib Figure object.
33+
"""
2334
Figure.__init__(self, *args, **kwargs)
2435
pygame.Surface.__init__(self, self.bbox.size)
2536
self.fill('white')
@@ -34,6 +45,7 @@ def set_bounding_rect(self, rect: pygame.Rect):
3445
# Redraw the figure
3546
self.canvas.draw()
3647

48+
3749
class RendererPygame(RendererBase):
3850
"""The renderer handles drawing/rendering operations.
3951
@@ -44,7 +56,6 @@ def __init__(self, dpi):
4456
super().__init__()
4557
self.dpi = dpi
4658

47-
4859
def draw_path(self, gc, path, transform, rgbFace=None):
4960

5061
if rgbFace is not None:

0 commit comments

Comments
 (0)