Skip to content

Commit 18b2fda

Browse files
committed
WIP
1 parent 3bf537b commit 18b2fda

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/users/explain/architecture.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,11 @@ class is ``matplotlib.artist.Artist``, which contains attributes that every
8686

8787
There is a hierarchy between artists in the same ``Figure``.
8888

89+
The coupling between the ``Artist`` hierarchy and the backend happens in the
90+
``draw`` method.
91+
92+
For example, in the mockup class below where we create SomeArtist which subclasses Artist, the essential method that SomeArtist must implement is draw, which is passed a renderer from the backend. The Artist doesn't know what kind of backend the renderer is going to draw onto (PDF, SVG, GTK+ DrawingArea, etc.) but it does know the Renderer API and will call the appropriate method (draw_text or draw_path). Since the Renderer has a pointer to its canvas and knows how to paint onto it, the draw method transforms the abstract representation of the Artist to colors in a pixel buffer, paths in an SVG file, or any other concrete representation.
93+
94+
There are two types of Artists: *primitive* and *composite* artists.
95+
96+
**Primitive artists** represent the kinds of objects you see in a plot: Line2D, Rectangle, Circle, and Text. Composite artists are collections of Artists such as the Axis, Tick, Axes, and Figure. Each composite artist may contain other composite artists as well as primitive artists. For example, the Figure contains one or more composite Axes and the background of the Figure is a primitive Rectangle.

0 commit comments

Comments
 (0)