| 1 | diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py |
| 2 | --- a/lib/matplotlib/axis.py |
| 3 | +++ b/lib/matplotlib/axis.py |
| 4 | @@ -2029,6 +2029,9 @@ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs): |
| 5 | other limits, you should set the limits explicitly after setting the |
| 6 | ticks. |
| 7 | """ |
| 8 | + if labels is None and kwargs: |
| 9 | + raise ValueError('labels argument cannot be None when ' |
| 10 | + 'kwargs are passed') |
| 11 | result = self._set_tick_locations(ticks, minor=minor) |
| 12 | if labels is not None: |
| 13 | self.set_ticklabels(labels, minor=minor, **kwargs) |