How to label graph curves?

조회 수: 10 (최근 30일)
Nisar Ahmed
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
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.
In your case,
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!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by