How to label graph curves?

10 vues (au cours des 30 derniers jours)
Nisar Ahmed
Nisar Ahmed le 15 Fév 2021
Commenté : Nisar Ahmed le 20 Fév 2021
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');

Réponse acceptée

Reshma Nerella
Reshma Nerella le 18 Fév 2021
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!
  1 commentaire
Nisar Ahmed
Nisar Ahmed le 20 Fév 2021
thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by