Skip to content

Feature request: Add interactive data cursor (data tip) functionality similar to MATLAB #489

Description

@oridong

Description of the feature / feature request

I would like to request an interactive data cursor feature similar to MATLAB's datacursormode.
This feature would allow users to click on a data point in a plot and display its (x, y)
coordinates (or (x, y, z) for 3D plots) in a tooltip.

Use case / What problem does it solve?

Currently, Matplot++ can generate static plots, but it lacks any interactive data inspection tools.
When exploring large datasets, it's very cumbersome to guess or approximate the exact coordinates
of a point visually. A data cursor would greatly improve the user experience for data analysis.

Proposed solution / Implementation ideas (optional)

  • When the user clicks a data point, a small label appears showing the point's coordinates.
  • Perhaps a simple API like plt::datacursormode(true) or an event callback.
  • The backend probably needs to handle mouse click events and map them to data coordinates, then
    render temporary text annotations.

Alternative solutions considered

Currently, there is no interactive alternative in Matplot++. Users have to rely on other libraries
or export data and use MATLAB/Python, which breaks the workflow.

Additional context

  • I’m using Matplot++ version: [your version, e.g., 1.2.2]
  • Platform: [e.g., Ubuntu 22.04 / Windows 11]
  • Compiler: [e.g., GCC 11.4]
  • This feature is common in many plotting toolkits (MATLAB, Matplotlib's mplcursors) and would
    make Matplot++ much more powerful for interactive data exploration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions