matlab 鼠标纵向平移,matlab使用鼠标以交互方式平移、缩放、居中查看绘图

INTERACTIVEMOUSE

After I made this in R13 and testing it in R14, I noticed that the PAN function had a similar functionality. However, This function has additional features (zoom and center view)

#######################################

INTERACTIVEMOUSE toggles the interactive mode of the current figure.

INTERACTIVEMOUSE ON turns on the interactive mode.

INTERACTIVEMOUSE OFF turns off the interactive mode.

INTERACTIVEMOUSE RESET sets the 'restore point' to the current view.

INTERACTIVEMOUSE RESTORE restores the view to the 'restore point'. The 'restore point' is predefined as the original view, unless the current view is set as the 'restore point' with RESET.

INTERACTIVEMOUSE RESTORE_ORIG restores the view to the original view (the view before INTERACTIVEMOUSE was initially called on this figure). This 'restore point' is fixed regardless of whether RESET was called or not.

INTERACTIVEMOUSE(FIG) and INTERACTIVEMOUSE(FIG, OPTION) applies to the figure specified by handle FIG. FIG can be a vector of figure handles. OPTION can be any of the above arguments. The figure(s) can have multiple axes.

The following features are included in the interactive mode:

Pan : click and drag.

Zoom : right click (or CNTRL-click) and drag.

Center View : double click.

Reset View : with the cursor over the axes region. This resets 'restore point'. (see above note about RESET option)

Restore View : with the cursor over the axes region. This restores to the 'restore point'. (see above note about RESTORE option)

Help window :

Exit mode :

Note about Zoom Feature:

(2D views) : the zoom ratio depends on the location of the pointer with respect to the initial click location. Pressing the key ONCE toggles the constrained mode. In CONSTRAINED mode, the zoom ratio is constrained along x-axis, y-axis, or xy-axes depending on the pointer location. The figure window title indicates that constraint mode is active. If the axes DataAspectRatioMode is MANUAL, the zoom will always be constrained to preserve the specified aspect ratio (PROPORTIONAL mode). This is for working with images.

(3D views) : the zoom is always xyz-constrained (PROPORTIONAL). The aspect ratios are always preserved.

In the interactive mode, several figure and axes properties are set, but the current properties are restored when the interactive mode is exited. During interactive mode, the figure name changes to 'InteractiveMouse', and the figure is undocked (certain features don't work in docked mode). This works with 2D plots, images, and 3D plots (for the most part).

Examples:

% Interactively examine high frequency noise

x=0:.001:10;

y=sin(x)+.01*rand(size(x));

plot(x,y)

interactivemouse;

% Multiple axes

load clown;

subplot(211);image(X);colormap(map);axis image;

subplot(212);plot(rand(100,1), '.-');

interactivemouse;

% Use LINKAXES to link multiple axes. (>R13)

ax(1)=subplot(211);plot(rand(100,1), 'r.-');

ax(2)=subplot(212);plot(rand(100,1), '.-');

linkaxes(ax);

interactivemouse;

See also zoom, pan, linkaxes

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值