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

Skip to content

Commit 72d3152

Browse files
authored
Fix typing error
`plt.subplot(1, 2)` should be `plt.subplots(1, 2)`, otherwise raises `TypeError: subplot() takes 1 or 3 positional arguments but 2 were given`
1 parent c486cd7 commit 72d3152

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,8 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
13151315
fig, axs = plt.subplots(2, 2)
13161316
13171317
# using tuple unpacking for multiple Axes
1318-
fig, (ax1, ax2) = plt.subplot(1, 2)
1319-
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplot(2, 2)
1318+
fig, (ax1, ax2) = plt.subplots(1, 2)
1319+
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
13201320
13211321
The names ``ax`` and pluralized ``axs`` are preferred over ``axes``
13221322
because for the latter it's not clear if it refers to a single

0 commit comments

Comments
 (0)