How to draw the legend with text in sprite line?

1 回表示 (過去 30 日間)
HONG CHENG
HONG CHENG 2016 年 11 月 24 日
編集済み: HONG CHENG 2016 年 11 月 24 日
Now I am doing some simulation.
But when I finished the main part, I have spent a lot time on the legend. My legend codes is as follows:
lgd = legend([s1,p1,p2,p3,p4],... 'n_L_O_S=2.1 \sigma_L_O_S=3.6dB', '(\alpha _N_L_O_S,\beta_N_L_O_S)=(79.2dB,2.6) \sigma_N_L_O_S=9.6dB'... ,'n_N_L_O_S=3.4 \sigma_N_L_O_S=9.7dB','Probabilistic Path Loss (Floating)','Probabilistic Path Loss (Close-In)','Location','best'); lgd.FontWeight = 'bold';
And then my result is like this
But what I want to do is like the next Figure
If you know the method to change the legend ,Please Comment .
Thanks a lot!!

採用された回答

HONG CHENG
HONG CHENG 2016 年 11 月 24 日
編集済み: HONG CHENG 2016 年 11 月 24 日
Thank you And I have solve this Problem by this
t2 = ['(\alpha _N_L_O_S,\beta_N_L_O_S)=(79.2dB,2.6) ', sprintf('\n'),'\sigma_N_L_O_S=9.6dB'];
and It looks like this:

その他の回答 (2 件)

KSSV
KSSV 2016 年 11 月 24 日
Legend depends on what markers and colors you have used during plotting. Check your plot specifications.
clc; clear all ;
plot(rand(10,1),'Ob') ;
hold on
plot(rand(10,1),'-m') ;
plot(rand(10,1),'-r') ;
plot(rand(10,1),'--b') ;
plot(rand(10,1),'-k') ;
plot(rand(10,1),'--b') ;
lgd = legend('n_L_O_S=2.1 \sigma_L_O_S=3.6dB', '(\alpha _N_L_O_S,\beta_N_L_O_S)=(79.2dB,2.6) \sigma_N_L_O_S=9.6dB'...
,'n_N_L_O_S=3.4 \sigma_N_L_O_S=9.7dB','Probabilistic Path Loss (Floating)','Probabilistic Path Loss (Close-In)','Location','best');
% lgd.FontWeight = 'bold';
  1 件のコメント
HONG CHENG
HONG CHENG 2016 年 11 月 24 日
Thanks for your advice

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


Walter Roberson
Walter Roberson 2016 年 11 月 24 日
  1 件のコメント
HONG CHENG
HONG CHENG 2016 年 11 月 24 日
Thanks for your advice

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

カテゴリ

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