-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
Bug report
Bug summary
matplotlib.pyplot.subplot2grid fails with TypeError when given a figure-argument.
Code for reproduction
import matplotlib.pyplot as plt
f = plt.figure()
ax1 = plt.subplot2grid((2, 2), (0, 0), colspan=2, fig=f)
It even fails for this:
import matplotlib.pyplot as plt
ax1 = plt.subplot2grid((2, 2), (0, 0), colspan=2, fig=None)
Actual outcome
Traceback (most recent call last):
File "filename.py", line 4, in <module>
ax1 = plt.subplot2grid((2, 2), (0, 0), colspan=2, fig=f)
File "/usr/lib/python3.6/site-packages/matplotlib/pyplot.py", line 1292, in subplot2grid
a = fig.add_subplot(subplotspec, **kwargs)
File "/usr/lib/python3.6/site-packages/matplotlib/figure.py", line 1021, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
TypeError: __init__() got multiple values for argument 'fig'
Matplotlib version
- Operating System: 4.11.6-3-ARCH
- Matplotlib Version: 2.0.2
- Python Version: 3.6.1
- Jupyter Version (if applicable): ---
- Other Libraries: ---
Installed via official repositories.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels