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

Skip to content
Closed
Prev Previous commit
Next Next commit
Further tweaks re add_axes.
  • Loading branch information
Phil Elson committed Feb 6, 2012
commit 7674dcdc0aa745de9bc995a01abda774b0a3e6ca
2 changes: 1 addition & 1 deletion lib/matplotlib/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8439,7 +8439,7 @@ def label_outer(self):

_subplot_classes = {}
def subplot_class_factory(axes_class=None):
# This makes a new class that inherits from SubclassBase and the
# This makes a new class that inherits from SubplotBase and the
# given axes_class (which is assumed to be a subclass of Axes).
# This is perhaps a little bit roundabout to make a new class on
# the fly like this, but it means that a new Subplot class does
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,16 +703,15 @@ def add_axes(self, *args, **kwargs):
projection = 'polar'

if isinstance(projection, basestring) or projection is None:
projection_class = get_projection_class(projection)
a = projection_factory(projection, self, rect, **kwargs)
elif hasattr(projection, '_as_mpl_axes'):
projection_class, extra_kwargs = projection._as_mpl_axes()
kwargs.update(**extra_kwargs)
a = projection_class(self, rect, **kwargs)
else:
TypeError('projection must be a string, None or implement a '
'_as_mpl_axes method. Got %r' % projection)

a = projection_factory(projection, self, rect, **kwargs)

self._axstack.add(key, a)
self.sca(a)
return a
Expand Down