How to plot the two legend in a Matlab Figure?

1 回表示 (過去 30 日間)
Shashibhushan Sharma
Shashibhushan Sharma 2018 年 9 月 27 日
編集済み: Shashibhushan Sharma 2018 年 9 月 27 日
I have used the command for two legend as:
legend([Q1 Q2 Q3 Q4], 'Analytical, P_S=0 dBW', 'Simulation, P_S=0 dBW','Analytical, P_S=5 dBW', 'Simulation, P_S=5 dBW');
d=axes('position',get(gca,'position'),'visible','off');
legend(d,[Q5 Q6 Q7 Q8], 'Analytical, P_S=10 dBW', 'Simulation, P_S=10 dBW','Analytical, P_S=15 dBW', 'Simulation, P_S=15 dBW','Location','EastOutside');
where Q1 to Q8 are the Figures, for example; Q1= semilogy(x, y); same way Q2 and other. I also got the two Legend in a figure, but I don't understands about the command 'd=axes('position',get(gca,'position'),'visible','off');'.
Please help me clearly if someone known about it. I want to know;
  • (1) what is "axes();"?
  • (2) what is "get();"?
  • (3) what is "'gca';"?
  • (4) why do we use this "'visible','off'"?
  • (5) again why do we use this "axes('position',get(gca,'position'),'visible','off');"?

採用された回答

KSSV
KSSV 2018 年 9 月 27 日
  • (1) what is "axes(); creates cartesian axes i.e x and y axes.
  • (2) what is "get(); get is used to get the required parameters like position etc.
  • (3) what is "'gca'; it stands for get the current axes..gives you control on the present axes
  • (4) why do we use this "'visible','off'": It will make the visibility of plot off..it doesnt show the picture.
  • (5) again why do we use this "axes('position',get(gca,'position'),'visible','off'); This will get the current positon of the current axes and makes the axes visibility off.
It is not suggested to ask basic questions in the forum. YOu can read it on your own..MATLAB is rich in documentation.
  1 件のコメント
Shashibhushan Sharma
Shashibhushan Sharma 2018 年 9 月 27 日
編集済み: Shashibhushan Sharma 2018 年 9 月 27 日
Thank you sir to these basic pieces of knowledge. Sorry for your disturbance. But, I have seen that these types of basic questions have been arisen by someone. Answers to those questions are not clear by me. This is the reason to arise the questions. Nevertheless, from next time, first, I try to understand the basic question by reading. If I do not understand then I will ask.

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

その他の回答 (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