MATLAB Answers

legend in subplot graph

14 views (last 30 days)
pramod kumar
pramod kumar on 29 Jan 2021
Answered: VBBV on 29 Jan 2021
how to give legend for multiple graph case.
subplot(3,1,1)
plot(tn,transpose(utdelt(1,:)),'-r');
title('Displacement in X-Direction')
xlabel('time(sec)');
ylabel('Displacement (m)');
hold on
plot(tn,transpose(utdelt(28,:)),'-g');
title('Displacement in X-Direction')
xlabel('time(sec)');
ylabel('Displacement (m)');
  1 Comment
Alex Alex
Alex Alex on 29 Jan 2021
command "legend" ?

Sign in to comment.

Answers (1)

VBBV
VBBV on 29 Jan 2021
legend('name1','name2')

Community Treasure Hunt

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

Start Hunting!