how to plot mouse movment without missing any point

1 view (last 30 days)
Hii every one I need help In my project I am ploting mouse movment on x and y axes. But in that some points misses..
This is how I am using plot..
p = get(h_axes,'CurrentPoint');
x = p(1,1);
y = p(1,2);
x_pen = [x_pen x];
y_pen = [y_pen y];
plot( h_axes,[x_pen(end-1) x],[y_pen(end-1) y]','b.-', ...
'MarkerEdgeColor','k', 'MarkerFaceColor','b', ...
'MarkerSize',10, 'Tag','TRAJECTORIA' );
I am devloping pen like tool which in which I want to plots mouse tracing continously but some points misses,,.. Is there any way to solve this..
  2 Comments
per isakson
per isakson on 29 Jan 2015
Edited: per isakson on 29 Jan 2015
  • Is this code inside a loop?
  • Which Matlab release?
  • Is&nbsp hold on ?
  • Only the two most recent points are displayed. Is that by intent?
chhaya gohel
chhaya gohel on 30 Jan 2015
sir i am capturing mouse movment from mouse button down to next up event.
so this code is in WindowButtonMotionFcn@movment where movment is my function for capturing and plotting co-ordinates..
hold is on
and not just two but all the points of mouse movment is going to be plot.. but the problem is some points misses during this plot ..

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 30 Jan 2015
If you have the Image Processing Toolbox, how about using imfreehand()? Demos attached.
  1 Comment
chhaya gohel
chhaya gohel on 30 Jan 2015
thank you sir.. now with this code i can add the points with interpolation..
but my problem is still there..
sir actully i am capturing mouse movment and same time plotting it..
so when x and y co ordinate Reaptes it will be taken as a junction point. So I need to get the points without missing any of them..
Suppose
X -> 1.2 1.3 1.5 1.6
y->1.4,1.6,1.7,1.8
here in x 1.4 and in y 1.5 in missing so I will not get continouse
plotting and that’s why I am not getting reaptes points even if I draw in such way that points get reapted..
so is there any way to add this points without distrbing the existing point..
i can not add points dynamically , it is very time consuming anf the size of x and y changes with my free hand drawing so how to solve it

Sign in to comment.

Categories

Find more on Line 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!