代码之家  ›  专栏  ›  技术社区  ›  dewalla

如何在Matlab中向三维绘图添加“指针”注释?

  •  1
  • dewalla  · 技术社区  · 16 年前

    我想在三维绘图中添加一个“指针”。
    我希望这个“指针”指向我画的球体上的某个点。
    这个指针不需要有箭头,但如果有箭头的话会很好。

    谢谢你的帮助!

    3 回复  |  直到 13 年前
        1
  •  3
  •   zellus    16 年前

    来自MathWorks文档的普通副本。有关更多详细信息,请查看 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);
    
        2
  •  3
  •   Amro    16 年前

    还要确保检查出优秀的 ARROW 由提交 埃里克约翰逊 (可追溯到2000年,但在2009年更新)。

    screenshot http://www.mathworks.com/matlabcentral/fx_files/278/3/arrow_demo.png

        3
  •  2
  •   High Performance Mark    16 年前

    添加箭头之类的简单方法是使用绘图工具。通过单击包含所绘制图形的窗口上工具栏中最右边的图标,可以激活绘图工具。一旦你得到了你想要的箭头,你就可以从图形中生成m文件。