Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 947ebe9

Browse filesBrowse files
committed
Deprecate locatable_axes_factory and make it a no-op.
It's similar to LocatableAxesBase and provided in base Axes classes.
1 parent 15d9b8e commit 947ebe9
Copy full SHA for 947ebe9

File tree

Expand file treeCollapse file tree

3 files changed

+11
-13
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-13
lines changed

‎lib/mpl_toolkits/axes_grid1/axes_divider.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/axes_divider.py
+6-9Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -872,18 +872,15 @@ class LocatableAxesBase(object):
872872
pass
873873

874874

875-
@functools.lru_cache(None)
875+
@cbook.deprecated('3.0',
876+
addendum=' There is no alternative. Classes derived from '
877+
'matplotlib.axes.Axes provide this functionality '
878+
'already.')
876879
def locatable_axes_factory(axes_class):
877-
return type("Locatable%s" % axes_class.__name__,
878-
(axes_class, ),
879-
{'_axes_class': axes_class})
880+
return axes_class
880881

881882

882883
def make_axes_locatable(axes):
883-
if not hasattr(axes, "set_axes_locator"):
884-
new_class = locatable_axes_factory(type(axes))
885-
axes.__class__ = new_class
886-
887884
divider = AxesDivider(axes)
888885
locator = divider.new_locator(nx=0, ny=0)
889886
axes.set_axes_locator(locator)
@@ -906,4 +903,4 @@ def make_axes_area_auto_adjustable(ax,
906903

907904
#from matplotlib.axes import Axes
908905
from .mpl_axes import Axes
909-
LocatableAxes = locatable_axes_factory(Axes)
906+
LocatableAxes = Axes

‎lib/mpl_toolkits/axes_grid1/axes_rgb.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/axes_rgb.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
2-
from .axes_divider import make_axes_locatable, Size, locatable_axes_factory
2+
3+
from .axes_divider import make_axes_locatable, Size
34
from .mpl_axes import Axes
45

56

@@ -23,9 +24,9 @@ def make_rgb_axes(ax, pad=0.01, axes_class=None, add_all=True):
2324
ax_rgb = []
2425
if axes_class is None:
2526
try:
26-
axes_class = locatable_axes_factory(ax._axes_class)
27+
axes_class = ax._axes_class
2728
except AttributeError:
28-
axes_class = locatable_axes_factory(type(ax))
29+
axes_class = type(ax)
2930

3031
for ny in [4, 2, 0]:
3132
ax1 = axes_class(ax.get_figure(),

‎lib/mpl_toolkits/axisartist/axes_divider.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axes_divider.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
make_axes_locatable)
44

55
from mpl_toolkits.axisartist.axislines import Axes
6-
LocatableAxes = locatable_axes_factory(Axes)
6+
LocatableAxes = Axes

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.