how to trace all the coordinates on the graph drawn by mouse pointer.
2 views (last 30 days)
Show older comments
please some can tell that how to find out all coordinates drawn by the mouse pointer and assign these coordinats in array.
for example let suppose this blue one curve is drawn by my mouse pointer, then how to find all the coordinate of this curve and assign into a array. ofcourse there should be a step size between the coordinates.
Thank You.
0 Comments
Answers (1)
DGM
on 4 Dec 2021
It depends what you mean by "drawn with the mouse". What are you using to draw with the mouse?
If you have IPT, you can use imfreehand() or drawfreehand()
% just make some dummy plot so that an axes exists
x = 1:10;
plot(x); hold on
% draw a curve and get the points
hf = drawfreehand(gca);
pointlist = hf.Position
delete(hf) % delete if unneeded
% show that point list corresponds to the drawn object
plot(pointlist(:,1),pointlist(:,2),'x:')
The spacing is velocity-dependent. You can reduce the relative spacing scale afterwards by simply subsampling the point list.
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!