|
13 | 13 | import functools
|
14 | 14 |
|
15 | 15 | import matplotlib.transforms as mtransforms
|
| 16 | +from matplotlib import cbook |
16 | 17 | from matplotlib.axes import SubplotBase
|
17 | 18 | from . import axes_size as Size
|
18 | 19 |
|
@@ -863,54 +864,18 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
|
863 | 864 | return mtransforms.Bbox.from_bounds(x1, y1, w1, h1)
|
864 | 865 |
|
865 | 866 |
|
| 867 | +@cbook.deprecated('3.0', |
| 868 | + addendum=' There is no alternative. Deriving from ' |
| 869 | + 'matplotlib.axes.Axes provides this functionality ' |
| 870 | + 'already.') |
866 | 871 | class LocatableAxesBase(object):
|
867 |
| - def __init__(self, *kl, **kw): |
868 |
| - |
869 |
| - self._axes_class.__init__(self, *kl, **kw) |
870 |
| - |
871 |
| - self._locator = None |
872 |
| - self._locator_renderer = None |
873 |
| - |
874 |
| - def set_axes_locator(self, locator): |
875 |
| - self._locator = locator |
876 |
| - |
877 |
| - def get_axes_locator(self): |
878 |
| - return self._locator |
879 |
| - |
880 |
| - def apply_aspect(self, position=None): |
881 |
| - |
882 |
| - if self.get_axes_locator() is None: |
883 |
| - self._axes_class.apply_aspect(self, position) |
884 |
| - else: |
885 |
| - pos = self.get_axes_locator()(self, self._locator_renderer) |
886 |
| - self._axes_class.apply_aspect(self, position=pos) |
887 |
| - |
888 |
| - def draw(self, renderer=None, inframe=False): |
889 |
| - |
890 |
| - self._locator_renderer = renderer |
891 |
| - |
892 |
| - self._axes_class.draw(self, renderer, inframe) |
893 |
| - |
894 |
| - def _make_twin_axes(self, *kl, **kwargs): |
895 |
| - """ |
896 |
| - Need to overload so that twinx/twiny will work with |
897 |
| - these axes. |
898 |
| - """ |
899 |
| - if 'sharex' in kwargs and 'sharey' in kwargs: |
900 |
| - raise ValueError("Twinned Axes may share only one axis.") |
901 |
| - ax2 = type(self)(self.figure, self.get_position(True), *kl, **kwargs) |
902 |
| - ax2.set_axes_locator(self.get_axes_locator()) |
903 |
| - self.figure.add_axes(ax2) |
904 |
| - self.set_adjustable('datalim') |
905 |
| - ax2.set_adjustable('datalim') |
906 |
| - self._twinned_axes.join(self, ax2) |
907 |
| - return ax2 |
| 872 | + pass |
908 | 873 |
|
909 | 874 |
|
910 | 875 | @functools.lru_cache(None)
|
911 | 876 | def locatable_axes_factory(axes_class):
|
912 | 877 | return type("Locatable%s" % axes_class.__name__,
|
913 |
| - (LocatableAxesBase, axes_class), |
| 878 | + (axes_class, ), |
914 | 879 | {'_axes_class': axes_class})
|
915 | 880 |
|
916 | 881 |
|
|
0 commit comments