|
60 | 60 | # animation.
|
61 | 61 | #
|
62 | 62 | # The update function uses the `set_*` function for different artists to modify
|
63 |
| -# the data. |
64 |
| -# |
65 |
| -# ============================= =========================================== |
66 |
| -# Artist Set method |
67 |
| -# ============================= =========================================== |
68 |
| -# `.lines.Line2D` `.lines.Line2D.set_data` |
69 |
| -# `.collections.PathCollection` `.collections.PathCollection.set_offsets` |
70 |
| -# `.image.AxesImage` `.image.AxesImage.set_data` |
71 |
| -# `.text.Annotation` `.text.Annotation.update_positions` |
72 |
| -# `.patches.Rectangle` `.Rectangle.set_angle`, |
73 |
| -# `.Rectangle.set_bounds`, |
74 |
| -# `.Rectangle.set_height`, |
75 |
| -# `.Rectangle.set_width`, |
76 |
| -# `.Rectangle.set_x`, `.Rectangle.set_y` |
77 |
| -# `.Rectangle.set_xy` |
78 |
| -# `.patches.Polygon` `.Polygon.set_xy` |
79 |
| -# `.patches.Ellipse` `.Ellipse.set_angle`, |
80 |
| -# `.Ellipse.set_center`, |
81 |
| -# `.Ellipse.set_height`, `.Ellipse.set_width` |
82 |
| -# ============================= =========================================== |
83 |
| -# |
84 |
| -# Other such set methods can be looked up in the artist documentation. An |
85 |
| -# example for animating a `.Axes.scatter` plot is |
| 63 | +# the data. The following table shows a few example methods, the artist types |
| 64 | +# they return and the methods that can be used to update them. |
| 65 | +# |
| 66 | +# ================= ============================= =========================== |
| 67 | +# Plotting method Artist Set method |
| 68 | +# ================= ============================= =========================== |
| 69 | +# `.Axes.plot` `.lines.Line2D` `.lines.Line2D.set_data` |
| 70 | +# `.Axes.scatter` `.collections.PathCollection` `.collections.PathCollecti\ |
| 71 | +# on.set_offsets` |
| 72 | +# `.Axes.imshow` `.image.AxesImage` `.image.AxesImage.set_data` |
| 73 | +# `.Axes.annotate` `.text.Annotation` `.text.Annotation.update_p\ |
| 74 | +# ositions` |
| 75 | +# `.Axes.barh` `.patches.Rectangle` `.Rectangle.set_angle`, |
| 76 | +# `.Rectangle.set_bounds`, |
| 77 | +# `.Rectangle.set_height`, |
| 78 | +# `.Rectangle.set_width`, |
| 79 | +# `.Rectangle.set_x`, |
| 80 | +# `.Rectangle.set_y` |
| 81 | +# `.Rectangle.set_xy` |
| 82 | +# `.Axes.fill` `.patches.Polygon` `.Polygon.set_xy` |
| 83 | +# `.patches.Circle` `.patches.Ellipse` `.Ellipse.set_angle`, |
| 84 | +# `.Ellipse.set_center`, |
| 85 | +# `.Ellipse.set_height`, |
| 86 | +# `.Ellipse.set_width` |
| 87 | +# ================= ============================= =========================== |
| 88 | +# |
| 89 | +# Covering the set methods for all types of artists is beyond the scope of this |
| 90 | +# tutorial but can be found in their respective documentations. An example of |
| 91 | +# such update methods in use for `.Axes.scatter` is as follows. |
86 | 92 |
|
87 | 93 |
|
88 | 94 | fig, ax = plt.subplots()
|
|
0 commit comments