| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3512,7 +3512,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs): | |||
| 3512 | 3512 | Return value is the :class:`matplotlib.patches.Polygon` | |
| 3513 | 3513 | instance. | |
| 3514 | 3514 | ||
| 3515 | - Examples: | ||
| 3515 | + Examples:: | ||
| 3516 | 3516 | ||
| 3517 | 3517 | # draw a vertical green translucent rectangle from x=1.25 to 1.55 | |
| 3518 | 3518 | # that spans the yrange of the axes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,11 +41,18 @@ | |||
| 41 | 41 | ||
| 42 | 42 | class AxesStack(Stack): | |
| 43 | 43 | """ | |
| 44 | - Specialization of the Stack to handle all | ||
| 45 | - tracking of Axes in a Figure. This requires storing | ||
| 46 | - key, (ind, axes) pairs. The key is based on the args and kwargs | ||
| 47 | - used in generating the Axes. ind is a serial number for tracking | ||
| 48 | - the order in which axes were added. | ||
| 44 | + Specialization of the Stack to handle all tracking of Axes in a Figure. | ||
| 45 | + This stack stores ``key, (ind, axes)`` pairs, where: | ||
| 46 | + | ||
| 47 | + * **key** should be a hash of the args and kwargs | ||
| 48 | + used in generating the Axes. | ||
| 49 | + * **ind** is a serial number for tracking the order | ||
| 50 | + in which axes were added. | ||
| 51 | + | ||
| 52 | + The AxesStack is a callable, where ``ax_stack()`` returns | ||
| 53 | + the current axes. Alternatively the :meth:`current_key_axes` will | ||
| 54 | + return the current key and associated axes. | ||
| 55 | + | ||
| 49 | 56 | """ | |
| 50 | 57 | def __init__(self): | |
| 51 | 58 | Stack.__init__(self) | |
@@ -74,9 +81,14 @@ def _entry_from_axes(self, e): | |||
| 74 | 81 | return (k, (ind, e)) | |
| 75 | 82 | ||
| 76 | 83 | def remove(self, a): | |
| 84 | + """Remove the axes from the stack.""" | ||
| 77 | 85 | Stack.remove(self, self._entry_from_axes(a)) | |
| 78 | - | ||
| 86 | + | ||
| 79 | 87 | def bubble(self, a): | |
| 88 | + """ | ||
| 89 | + Move the given axes, which must already exist in the | ||
| 90 | + stack, to the top. | ||
| 91 | + """ | ||
| 80 | 92 | return Stack.bubble(self, self._entry_from_axes(a)) | |
| 81 | 93 | ||
| 82 | 94 | def add(self, key, a): | |
@@ -108,7 +120,12 @@ def add(self, key, a): | |||
| 108 | 120 | return Stack.push(self, (key, (self._ind, a))) | |
| 109 | 121 | ||
| 110 | 122 | def current_key_axes(self): | |
| 111 | - """Return a tuple of (key, axes) for the active axes.""" | ||
| 123 | + """ | ||
| 124 | + Return a tuple of ``(key, axes)`` for the active axes. | ||
| 125 | + | ||
| 126 | + If no axes exists on the stack, then returns ``(None, None)``. | ||
| 127 | + | ||
| 128 | + """ | ||
| 112 | 129 | if not len(self._elements): | |
| 113 | 130 | return self._default, self._default | |
| 114 | 131 | else: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments