# How to label graph curves?

33 ビュー (過去 30 日間)
Nisar Ahmed 2021 年 2 月 15 日
コメント済み: Nisar Ahmed 2021 年 2 月 20 日
Hello,
I have attached a figure in which Rpp is plotted at different angles and I want to label each graph with incident angle. say graph first is angle 10 degree etc. How can I add labeling here? The code of figure is copied here.
figure(4),
subplot(1,5,1);
plot(Out(:,1),time);
xlabel('Rpp')
ylabel('Time (ms)')
set(gca, 'ydir', 'reverse');
subplot(1,5,2);
plot(Out(:,10),time);
set(gca, 'ydir', 'reverse');
subplot(1,5,3);
plot(Out(:,20),time);
set(gca, 'ydir', 'reverse');
subplot(1,5,4);
plot(Out(:,30),time);
set(gca, 'ydir', 'reverse');
subplot(1,5,5);
plot(Out(:,40),time);
set(gca, 'ydir', 'reverse');

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

### 採用された回答

Reshma Nerella 2021 年 2 月 18 日
Hi,
From my understanding, you have multiple subplots and what to label each of them with the incident angle.
After creating subplot, you can add xlabel, ylabel, title for that specific plot and you can do this for all the subplots.
You can add title to the each subplot with the incident angle after you create it.
For instance,
subplot(1,5,2);
plot(Out(:,10),time);
set(gca, 'ydir', 'reverse');
title('10 degree incident angle');
subplot(1,5,3);
plot(Out(:,20),time);
set(gca, 'ydir', 'reverse');
title('20 degree incident angle');
For more information and examples, refer to the documentation page of subplot.
Hope this helps!
##### 1 件のコメント表示非表示 なし
Nisar Ahmed 2021 年 2 月 20 日
thanks

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

### Community Treasure Hunt

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

Start Hunting!