Create_2D_Vertices_​by_Mouse.m

Generating 2D points by clicking on the figure

You are now following this Submission

This script generates a small GUI panel that allows you to generate arbitrary number of 2D points by clicking on an existing axis. The usage is pretty self-understanding once you open the panel. Only two inputs are needed: the handle of the figure and the handle of the axis;
x = Create_2D_Vertices_by_Mouse(h_f, h_a)
================================= Creating 2D vertices by clicking mouse on an existing axis
Copyright @ W. Shan, 07.2014
=================================
inputs:
h_f: handle of the figure containing the axis, on which you want to click on
h_a: handle of the axis, on which you want to click on

output:
x: coordinates of the vertices, in row vectors
=================================

Have fun!

Cite As

Wenzhe Shan (2026). Create_2D_Vertices_by_Mouse.m (https://www.mathworks.com/matlabcentral/fileexchange/47118-create_2d_vertices_by_mouse-m), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Interactive Control and Callbacks in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0