How to change the cursor

4 visualizaciones (últimos 30 días)
Kirill Morozov
Kirill Morozov el 3 de Feb. de 2018
Comentada: Jan el 4 de Feb. de 2018
I have a gui form and there're axes.
When the graph has built in the axes by plot(), is it possible to set the cursor at the position of the last point of the graph?
Thank you.
  7 comentarios
Jan
Jan el 4 de Feb. de 2018
@Image Analyst: getpixelposition helps.
Jan
Jan el 4 de Feb. de 2018
@Kirill: It is still not clear, which "cursor" you mean.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 4 de Feb. de 2018
Here's some code to get you started with Java Robot:
import java.awt.Robot
import java.awt.event.*
mouse = Robot;
plot(1:10, 'bo-', 'LineWidth', 2);
grid on;
% ResetZoom(mouse);
% Reset the zoom so that the links will be at the same place every time.
y = 500
for x = 500 : 50 : 700
fprintf('x = %d, y = %d\n', x, y);
mouse.mouseMove(x, y);
% Set a breakpoint on the next line and wiggle your mouse to see if it put it in the right place.
% % Press the mouse button.
% mouse.mousePress(InputEvent.BUTTON1_MASK);
% mouse.mouseRelease(InputEvent.BUTTON1_MASK);
pause(0.5); % Wait at that spot for user to see it.
end

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by