Filter löschen
Filter löschen

ginput question

7 Ansichten (letzte 30 Tage)
vsee
vsee am 2 Sep. 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

Antworten (1)

Grzegorz Knor
Grzegorz Knor am 2 Sep. 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

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by