Making looping plots interactive with zoom and pan

2 次查看(过去 30 天)
I have a set of data (2D space, 1D time), which I normally make movies out of.
I'd like to create a GUI in Matlab in which I can loop over the data in time, like a movie, but allow the user to interactively use the plotting tools (zoom, pan specifically) while the loop is still going. Perhaps also have a "pause" and "rewind/forward" slider bar.
It seems like someone would have already done this, but I'm not finding that functionality on the FEX.
If not, it seems like I can do this with capturing zoom and pan events, and a while loop doing the plotting. Does this seem feasible?

回答(1 个)

Chad Greene
Chad Greene 2014-11-20
编辑:Chad Greene 2014-11-20
Check out how Carlos Adrian Vargas Aguilera does it with ginput2.
There's a lot to decipher there, so perhaps you could do something like
if waitforbuttonpress % waitforbuttonpress is 1 if user hits any keyboard key
char = get(gcf, 'CurrentCharacter'); % char is the character number of pressed key
if char == 122 % 122 is the character number of lowercase z
lim = axis; % get current axis limits
pti=get(axes_handle, 'CurrentPoint'); % get current cursor point
% center axis limits on cursor point:
axis([pti(1,1)+diff(lim(1:2))/2*[-1 1] pti(1,2)+diff(lim(3:4))/2*[-1 1]]);
zoom(2) % zoom in
end
end

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by