Moveit2 - Move a graphical object with the mouse.

版本 1.0.0.0 (1.7 KB) 作者: Anders Brun
Move graphical objects with your mouse. Works for pcolor, plot, patches and perhaps more.
4.0K 次下载
更新时间 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
moveit2(h);

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

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

引用格式

Anders Brun (2024). Moveit2 - Move a graphical object with the mouse. (https://www.mathworks.com/matlabcentral/fileexchange/23304-moveit2-move-a-graphical-object-with-the-mouse), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Formatting and Annotation 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0