ginput question

2 visualizaciones (últimos 30 días)
vsee
vsee el 2 de Sept. de 2011
How do I control ginput execution. If I am panning through a large data plot, and if I want to zoom in on the plot and then use ginput to get x and y values. ginput seems to take into effect immediately as the plot appears on the screen and blocks zoom in and many other functions.
Thanks

Respuestas (1)

Grzegorz Knor
Grzegorz Knor el 2 de Sept. de 2011
One possibility:
% Display a file
I = imread('rice.png');
imshow(I);
zoom on; % use mouse button to zoom in or out
% Press Enter to get out of the zoom mode.
% CurrentCharacter contains the most recent key which was pressed after opening
% the figure, wait for the most recent key to become the return/enter key
waitfor(gcf,'CurrentCharacter',13)
zoom reset
zoom off
[c,r,but] = ginput(1)
from:
Other idea:
Write function call:
function call(src,evnt)
if double(evnt.Character)==103
ginput(1)
end
And then plot your data in this way:
figure('keypressfcn',@call);plot(1:10)
The 'g' key will activate ginput function. But first you have to unmark all positions from figure toolbar.
Grzegorz

Categorías

Más información sobre Data Exploration en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by