Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d56c1c

Browse files
authored
Merge pull request #11683 from anntzer/unduplicate-axisdict
Reuse axes_grid1's AxisDict in axisartist, instead of duplicating it.
2 parents 51e77e1 + 13cca31 commit 5d56c1c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API deprecations
2+
````````````````
3+
4+
The following API elements are deprecated:
5+
6+
- ``mpl_toolkits.axisartist.axislines.SimpleChainedObjects``,
7+
``mpl_toolkits.Axes.AxisDict``,

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
In addition to AxisArtist, the Axes will have *gridlines* attribute,
3939
which obviously draws grid lines. The gridlines needs to be separated
4040
from the axis as some gridlines can never pass any axis.
41-
4241
"""
42+
4343
import numpy as np
4444

45-
from matplotlib import cbook
46-
from matplotlib import rcParams
45+
from matplotlib import cbook, rcParams
4746
import matplotlib.artist as martist
4847
import matplotlib.axes as maxes
4948
from matplotlib.path import Path
49+
from mpl_toolkits.axes_grid1 import mpl_axes
5050
from .axisline_style import AxislineStyle
5151
from .axis_artist import AxisArtist, GridlinesCollection
5252

@@ -483,6 +483,7 @@ def get_gridlines(self, which="major", axis="both"):
483483
return gridlines
484484

485485

486+
@cbook.deprecated("3.1")
486487
class SimpleChainedObjects(object):
487488
def __init__(self, objects):
488489
self._objects = objects
@@ -498,6 +499,7 @@ def __call__(self, *args, **kwargs):
498499

499500
class Axes(maxes.Axes):
500501

502+
@cbook.deprecated("3.1")
501503
class AxisDict(dict):
502504
def __init__(self, axes):
503505
self.axes = axes
@@ -545,7 +547,7 @@ def _init_axis_artists(self, axes=None):
545547
if axes is None:
546548
axes = self
547549

548-
self._axislines = self.AxisDict(self)
550+
self._axislines = mpl_axes.Axes.AxisDict(self)
549551
new_fixed_axis = self.get_grid_helper().new_fixed_axis
550552
for loc in ["bottom", "top", "left", "right"]:
551553
self._axislines[loc] = new_fixed_axis(loc=loc, axes=axes,

0 commit comments

Comments
 (0)