Moveit2 - Move a graphical object with the mouse.

バージョン (1.67 KB) 作成者: Anders Brun
Move graphical objects with your mouse. Works for pcolor, plot, patches and perhaps more.

ダウンロード 3.9K 件

更新 2009/3/16


This is really a small hack that I wanted to share just to inspire more people to make interactive Matlab graphics. Use it as is or use the code as a template to do more advanced stuff.

Here is how it works (for a 2-D patch):

% First make the patch ...
t = 0:2*pi/20:2*pi;
X = 3 + sin(t); Y = 2 + cos(t); Z = X*0;
h = patch(X,Y,Z,'g')
axis([-10 10 -10 10]);
% Then make it movable

It also works for e.g. pcolor and plot:

% Adjust data to fit hypothesis using the mouse ... :-)
a = plot(rand(10,10));


Anders Brun (2022). Moveit2 - Move a graphical object with the mouse. (, MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2009a
Windows macOS Linux
タグ タグの追加

Community Treasure Hunt

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

Start Hunting!