Skip to content

Commit 1102fa2

Browse files
committed
Support kwargs only calls to contour
1 parent 7f5335a commit 1102fa2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/matplotlib/contour.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs):
13861386
"""
13871387
Process args and kwargs.
13881388
"""
1389-
if isinstance(args[0], QuadContourSet):
1389+
if len(args) and isinstance(args[0], QuadContourSet):
13901390
if self.levels is None:
13911391
self.levels = args[0].levels
13921392
self.zmin = args[0].zmin

lib/matplotlib/tests/test_contour.py

+6
Original file line numberDiff line numberDiff line change
@@ -693,3 +693,9 @@ def test_contour_remove():
693693
assert ax.get_children() != orig_children
694694
cs.remove()
695695
assert ax.get_children() == orig_children
696+
697+
698+
def test_countour_kwargsonly():
699+
# Smoke test for GH#24743
700+
# Passing only kwargs
701+
plt.contour(Z=np.random.rand(30, 30))

0 commit comments

Comments
 (0)