Skip to content
masterclass Buddy

Plotly · Function

State

trace.on_click registers a Python callback for clicks on points in a Plotly trace. It works when the trace is in a displayed FigureWidget inside an ipywidget context.

Last updated

Syntax

trace.on_click(callback, append=False)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • plotly.graph_objects.FigureWidget
  • plotly.callbacks.Points
  • plotly.callbacks.InputDeviceState
  • plotly.graph_objects.Scatter
  • plotly.graph_objects.Figure

Source: Click events in Python. Checked 2026-11-03.