MOUSE_POINTS Input nodes from a grid.
Mouse_Points allows to input points using a variation of ginput Matlab function. The points will snap to the grid. The function returns the [n X Y] matrix (n = number of non repeated nodes, X = x coordinate, Y = y coordinate). The function is mouse friendly.
Left Click : add a point
Scroll : zoom in/out
Scroll Wheel click : pan
Double Scroll Wheel click : reset view to default view
Right click : set new default view
Enter : return [n X Y] matrix
Franklin Fabián Lucero Luna (2020). Ginput with snap to grid (https://www.mathworks.com/matlabcentral/fileexchange/62851-ginput-with-snap-to-grid), MATLAB Central File Exchange. Retrieved .
It would be nice if it would work with a figure that is already created, and if the user can specify the grid spacing. My need is that I have a shape with too many points and want to create a polygon of 8 to 12 points around it, but I want to force the grid snap to be 0.0025 units, whereas this program always uses a snap grid of 1.0 units.
Visit below link for Matlab Code
Inspired by: Mouse-friendly FIGURE