How to draw an arrow in Matlab?

前端 未结 5 1306
旧时难觅i
旧时难觅i 2020-11-30 06:00

I\'m trying to draw an arrow in matlab graph, without any success.

Code example:

function [ output_args ] = example( input_args )

figure (\'Name\',          


        
5条回答
  •  感动是毒
    2020-11-30 06:19

    Amongst other solutions, here is one using annotation where you can set the arrow properties including (x,y,width,height) within the current axes, the head and line properties.

    h=annotation('arrow');
    set(h,'parent', gca, ...
        'position', [50 5 20 2], ...
        'HeadLength', 1000, 'HeadWidth', 100, 'HeadStyle', 'hypocycloid', ...
        'Color', [0.4 0.1 0.8], 'LineWidth', 3);
    

    gives

    enter image description here

提交回复
热议问题