| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 72f2de3 commit f0ca259
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + pyplot.gca() | ||
| 2 | + ~~~~~~~~~~~~ | ||
| 3 | + | ||
| 4 | + Passing keyword arguments to ``.pyplot.gca`` will not be supported in a future | ||
| 5 | + release. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + ``figure._AxesStack`` | ||
| 2 | + ~~~~~~~~~~~~~~~~~~~~~ | ||
| 3 | + This internal class has been removed. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + Changes to behavior of Axes creation methods (gca(), add_axes(), add_subplot()) | ||
| 2 | + ------------------------------------------------------------------------------- | ||
| 3 | + | ||
| 4 | + The behavior of the functions to create new axes (``.pyplot.axes``, | ||
| 5 | + ``.pyplot.subplot``, ``.figure.Figure.add_axes``, | ||
| 6 | + ``.figure.Figure.add_subplot``) has changed. In the past, these functions would | ||
| 7 | + detect if you were attempting to create Axes with the same keyword arguments as | ||
| 8 | + already-existing axes in the current figure, and if so, they would return the | ||
| 9 | + existing Axes. Now, these functions will always create new Axes. A special | ||
| 10 | + exception is ``.pyplot.subplot``, which will reuse any existing subplot with a | ||
| 11 | + matching subplot spec. However, if there is a subplot with a matching subplot | ||
| 12 | + spec, then that subplot will be returned, even if the keyword arguments with | ||
| 13 | + which it was created differ. | ||
| 14 | + | ||
| 15 | + Correspondingly, the behavior of the functions to get the current Axes | ||
| 16 | + (``.pyplot.gca``, ``.figure.Figure.gca``) has changed. In the past, these | ||
| 17 | + functions accepted keyword arguments. If the keyword arguments matched an | ||
| 18 | + already-existing Axes, then that Axes would be returned, otherwise new Axes | ||
| 19 | + would be created with those keyword arguments. Now, the keyword arguments are | ||
| 20 | + only considered if there are no axes at all in the current figure. In a future | ||
| 21 | + release, these functions will not accept keyword arguments at all. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | import functools | |
| 2 | - import uuid | ||
| 3 | 2 | ||
| 4 | 3 | from matplotlib import _api, docstring | |
| 5 | 4 | import matplotlib.artist as martist | |
@@ -142,16 +141,7 @@ def _make_twin_axes(self, *args, **kwargs): | |||
| 142 | 141 | # which currently uses this internal API. | |
| 143 | 142 | if kwargs["sharex"] is not self and kwargs["sharey"] is not self: | |
| 144 | 143 | raise ValueError("Twinned Axes may share only one axis") | |
| 145 | - # The dance here with label is to force add_subplot() to create a new | ||
| 146 | - # Axes (by passing in a label never seen before). Note that this does | ||
| 147 | - # not affect plot reactivation by subplot() as twin axes can never be | ||
| 148 | - # reactivated by subplot(). | ||
| 149 | - sentinel = str(uuid.uuid4()) | ||
| 150 | - real_label = kwargs.pop("label", sentinel) | ||
| 151 | - twin = self.figure.add_subplot( | ||
| 152 | - self.get_subplotspec(), *args, label=sentinel, **kwargs) | ||
| 153 | - if real_label is not sentinel: | ||
| 154 | - twin.set_label(real_label) | ||
| 144 | + twin = self.figure.add_subplot(self.get_subplotspec(), *args, **kwargs) | ||
| 155 | 145 | self.set_adjustable('datalim') | |
| 156 | 146 | twin.set_adjustable('datalim') | |
| 157 | 147 | self._twinned_axes.join(self, twin) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -606,6 +606,9 @@ def __len__(self): | |||
| 606 | 606 | def __getitem__(self, ind): | |
| 607 | 607 | return self._elements[ind] | |
| 608 | 608 | ||
| 609 | + def as_list(self): | ||
| 610 | + return list(self._elements) | ||
| 611 | + | ||
| 609 | 612 | def forward(self): | |
| 610 | 613 | """Move the position forward and return the current element.""" | |
| 611 | 614 | self._pos = min(self._pos + 1, len(self._elements) - 1) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments