簡體   English   中英

如何在MATLAB中為3-D圖添加“指針”注釋?

[英]How to add a “pointer” annotation to a 3-D plot in MATLAB?

我想在3D圖中添加“指針”。
我希望這個“指針”指向我繪制的球體上的某個位置。
該指針不必具有箭頭,但是如果有的話將是很好的。

謝謝你的幫助!

MathWorks文檔中的純文本。 對於進一步的細節來看看這個

% 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);

另外,還要確保檢查一下Erik Johnson在FEX上提交的優秀箭頭 (可追溯到2000年,但在2009年進行了更新)。

屏幕截圖http://www.mathworks.com/matlabcentral/fx_files/278/3/arrow_demo.png

添加箭頭之類的簡單方法是使用“繪圖工具”。 您可以通過單擊包含已繪制圖形的窗口中工具欄上最右邊的圖標來激活“繪圖工具”。 一旦獲得所需的箭頭,便可以從圖形中生成m文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM