Making looping plots interactive with zoom and pan
7 ビュー (過去 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?
0 件のコメント
回答 (1 件)
Chad Greene
2014 年 11 月 20 日
編集済み: Chad Greene
2014 年 11 月 20 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Exploration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!