MATLAB Answers

Subplot titles on each column.

조회 수: 15(최근 30일)
I was making a subplot(2,2,i) (i is any value from 1 to 4). However, I could not find a method to lable each set of grphs.
Specifically to lable each column as a title. Here I would want them above the left hand side and one above the righ hand side.
Any ideas for in built functions?

  댓글 수: 3

KALYAN ACHARJYA
KALYAN ACHARJYA 2 Apr 2020
Wojciech Kalinowski comment moved here
No, that gives a subtitle for all four of them, sort of like a main title.
subplot(2,2,1)
plot(t, V, t, V_t)
xlabel('Time in seconds')
ylabel('Velocity in m/s')
title('Lunch equation comparison of velociteis')
legend('Equation provieded', "Tsiolkovsky's equation", 'location', 'best')
subplot(2,2,3)
plot(t, H, t, H_t)
xlabel('Time in seconds')
ylabel('Distance in meters')
title('Lunch equation comparison of hight')
legend('Equation provieded', "Tsiolkovsky's equation", 'location', 'best')
suptitle('Left hand side') % this to be on the left side
subplot(2,2,2)
plot(t, V2, t, V_t)
xlabel('Time in seconds')
ylabel('Velocity in m/s')
title('Lunch equation comparison of velociteis')
legend('Equation provieded', "Tsiolkovsky's equation", 'location', 'best')
subplot(2,2,4)
plot(t, H2, t, H_t)
xlabel('Time in seconds')
ylabel('Distance in meters')
title('Lunch equation comparison of hight')
legend('Equation provieded', "Tsiolkovsky's equation", 'location', 'best')
suptitle('Right hand side') % this to be on the right side
Essentialy making one "main" title instead of two seperate "main" titles for each collumn.
KALYAN ACHARJYA
KALYAN ACHARJYA 2 Apr 2020
Sorry, I missed the question. Are you looking for one main title over all same columns subplots?
Wojciech Kalinowski
Wojciech Kalinowski 2 Apr 2020
Yes, sorry if I was not clear.

로그인 to comment.

채택된 답변

darova
darova 2 Apr 2020
What about brute force?
clc,clear
clf
subplot 121
plot(0,0)
subplot 122
plot(1,1)
h1 = annotation('textbox',[0.25 0.95 0.2 0.05],...
'string','PLOT1');
h2 = annotation('textbox',[0.65 0.95 0.2 0.05],...
'string','PLOT2');
set([h1 h2], 'fitboxtotext','on',...
'edgecolor','none')

  댓글 수: 0

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

제품


릴리스

R2019a

Translated by