Skip to content

Commit 836a459

Browse files
author
Phil Elson
committed
Fixed error raising unittest case
1 parent 677a0ed commit 836a459

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎lib/matplotlib/figure.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def add_axes(self, *args, **kwargs):
700700
else:
701701
rect = args[0]
702702
projection_class, kwargs, key = \
703-
process_projection_requirements(self, **kwargs)
703+
process_projection_requirements(self, *args, **kwargs)
704704

705705
# check that an axes of this type doesn't already exist, if it
706706
# does, set it as active and return it
@@ -757,14 +757,15 @@ def add_subplot(self, *args, **kwargs):
757757

758758
if len(args) == 1 and isinstance(args[0], int):
759759
args = tuple([int(c) for c in str(args[0])])
760-
760+
761761
if isinstance(args[0], SubplotBase):
762+
762763
a = args[0]
763764
assert(a.get_figure() is self)
764-
key = self._make_key(*args, **kwargs)
765+
key = self._make_key(*args[1:], **kwargs)
765766
else:
766767
projection_class, kwargs, key = \
767-
process_projection_requirements(self, **kwargs)
768+
process_projection_requirements(self, *args, **kwargs)
768769

769770
# try to find the axes with this key in the stack
770771
ax = self._axstack.get(key)
@@ -781,7 +782,7 @@ def add_subplot(self, *args, **kwargs):
781782
# Without this, add_subplot would be simpler and
782783
# more similar to add_axes.
783784
self._axstack.remove(ax)
784-
785+
785786
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
786787

787788
self._axstack.add(key, a)

‎lib/matplotlib/tests/test_tightlayout.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,6 @@ def test_tight_layout6():
121121
h_pad=0.5)
122122

123123

124+
if __name__=='__main__':
125+
import nose
126+
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

0 commit comments

Comments
 (0)