如何添加“指针"MATLAB 中 3-D 图的注释? [英] How to add a "pointer" annotation to a 3-D plot in MATLAB?

查看:20
本文介绍了如何添加“指针"MATLAB 中 3-D 图的注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 3-D 图中添加一个指针".
我希望这个指针"指向我绘制的球体上的某个点.
这个指针不必有箭头,但如果有箭头就好了.

I want to add a "Pointer" to a 3-D plot.
I want this "pointer" to point at a certain spot on a sphere that I have drawn.
This pointer does not have to have an arrowhead but would be nice if it did.

感谢您的帮助!

推荐答案

来自 MathWorks 文档的普通副本.有关更多详细信息,请查看this.

Plain copy from The MathWorks documentation. For further details have a look at this.

% Create a sphere and color it using a topographic colormap:
cla reset;
load topo;
[x y z] = sphere(45);
s = surface(x,y,z,'FaceColor','texturemap','CData',topo);
colormap(topomap1);
% Brighten the colormap for better annotation visibility:
brighten(.6)
% Create and arrange the camera and lighting for better visibility:
campos([2 13 10]);
camlight;
lighting gouraud;
axis off vis3d;
% Set the x- and y-coordinates of the textarrow object:
x = [0.7698 0.5851];
y = [0.3593 0.5492];
% Create the textarrow object: 
txtar =  annotation('textarrow',x,y,'String','We are here.','FontSize',14);

这篇关于如何添加“指针"MATLAB 中 3-D 图的注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆