MATLAB Answers

Problem with subplot ful screen

2 views (last 30 days)
basma awad
basma awad on 27 Oct 2021
Answered: Jan on 27 Oct 2021
Hello
I am making a plot with 5 x2 plots using subplot. But when i plot the final figure doesnt show on the whole scrren like this.
Its not showing full screen
This is my code
t =[1 2 3];
figure()
subplot(10,2,1)
scatter(t,Aya(:,1))
xlim([0 4])
ylim([0 100])
title('Stimuli A')
grid on
subplot(10,2,2)
scatter(t,Aya(:,2))
xlim([0 4])
ylim([0 100])
title('Stimuli b')
grid on
subplot(10,2,3)
scatter(t,Farah(:,1))
xlim([0 4])
ylim([0 100])
title('Stimuli A')
subplot(10,2,4)
grid on
scatter(t,Farah(:,2))
xlim([0 4])
ylim([0 100])
title('Stimuli b')
grid on
subplot(10,2,5)
scatter(t,Hamza(:,1))
xlim([0 4])
ylim([0 100])
title('Stimuli A')
grid on
subplot(10,2,6)
scatter(t,Hamza(:,2))
xlim([0 4])
ylim([0 100])
title('Stimuli b')
grid on
subplot(10,2,7)
scatter(t,Jaffa(:,1))
xlim([0 4])
ylim([0 100])
title('Stimuli A')
grid on
subplot(10,2,8)
scatter(t,Jaffa(:,2))
xlim([0 4])
ylim([0 100])
title('Stimuli b')
grid on
subplot(10,2,9)
scatter(t,Monique(:,1))
xlim([0 4])
ylim([0 100])
title('Stimuli A')
grid on
subplot(10,2,10)
scatter(t,Monique(:,2))
xlim([0 4])
ylim([0 100])
title('Stimuli b')
grid on

Answers (1)

Jan
Jan on 27 Oct 2021
Yes, of course. You are creating a 10x2 table of plots:
subplot(10,2,1)
% ^^
Use subplot(5, 2, k) for a 5x2 table.

Community Treasure Hunt

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

Start Hunting!