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

Skip to content

Commit bf3116f

Browse files
committed
fixed an add_subplot bug
svn path=/trunk/matplotlib/; revision=2766
1 parent e42223e commit bf3116f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

lib/matplotlib/figure.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def add_axes(self, *args, **kwargs):
425425
if not len(args): return
426426
if isinstance(args[0], Axes):
427427
a = args[0]
428-
a.set_figure(self)
428+
assert(a.get_figure() is self)
429429
else:
430430
rect = args[0]
431431
ispolar = popd(kwargs, 'polar', False)
@@ -459,7 +459,6 @@ def add_subplot(self, *args, **kwargs):
459459
"""
460460

461461
key = self._make_key(*args, **kwargs)
462-
463462
if self._seen.has_key(key):
464463
ax = self._seen[key]
465464
self.sca(ax)
@@ -468,9 +467,9 @@ def add_subplot(self, *args, **kwargs):
468467

469468
if not len(args): return
470469

471-
if isinstance(args[0], Subplot) or isinstance(args, PolarSubplot):
470+
if isinstance(args[0], Subplot) or isinstance(args[0], PolarSubplot):
472471
a = args[0]
473-
a.set_figure(self)
472+
assert(a.get_figure() is self)
474473
else:
475474
ispolar = popd(kwargs, 'polar', False)
476475
if ispolar:

matplotlibrc.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ grid.linewidth : 0.5 # in points
171171

172172
### Legend
173173
legend.isaxes : True
174-
legend.numpoints : 4 # the number of points in the legend line
174+
legend.numpoints : 2 # the number of points in the legend line
175175
legend.fontsize : 14
176176
legend.pad : 0.2 # the fractional whitespace inside the legend border
177177
legend.markerscale : 1.0 # the relative size of legend markers vs. original

0 commit comments

Comments
 (0)