How to insert an arrow symbol in legend?

57 ビュー (過去 30 日間)
Amra Rajuli
Amra Rajuli 2018 年 4 月 16 日
コメント済み: Amra Rajuli 2018 年 4 月 16 日
Hi, I want to insert the arrow symbol in legend, but the arrow is not one of the plotted objects. I have tried to use the marker, but the result is not that good. I attach both images, the result of this script and the "wanted" result. Thank you.
[X,Y,Z] = peaks;
figure
[~,L3]= contour(X,Y,Z,10,'r');
hold on
q = 0;
L1= plot (xlim,[1 1]*q,'LineWidth',2);
tes=L1.Color
L1.Color='blue'
a=0
L2= plot ([1 1]*a,ylim,':k','LineWidth',2);
L4 = plot(NaN,NaN,'->b');
lgd=legend([L2 L3 L4],{'threshold','contour','arrow'},...
'location','northeast')
lgd.FontSize = 15;

採用された回答

KSSV
KSSV 2018 年 4 月 16 日
[X,Y,Z] = peaks;
figure
[~,L3]= contour(X,Y,Z,10,'r');
hold on
q = 0;
L1= plot (xlim,[1 1]*q,'LineWidth',2);
tes=L1.Color
L1.Color='blue'
a=0
L2= plot ([1 1]*a,ylim,':k','LineWidth',2);
L4 = quiver(10,10,1,0,'b');
lgd=legend([L2 L3 L4],{'threshold','contour','arrow'},...
 'location','northeast')
lgd.FontSize = 15;
axis([-3 3 -3 3])
  1 件のコメント
Amra Rajuli
Amra Rajuli 2018 年 4 月 16 日
thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by