diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 7e76aa39f8df..b676c7a754a1 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -67,7 +67,7 @@ def _contour_labeler_event_handler(cs, inline, inline_spacing, event): elif (is_button and event.button == MouseButton.LEFT # On macOS/gtk, some keys return None. or is_key and event.key is not None): - if event.inaxes == cs.ax: + if event.inaxes == cs.axes: cs.add_label_near(event.x, event.y, transform=False, inline=inline, inline_spacing=inline_spacing) canvas.draw()