Re scaling the axis of a figure

2 views (last 30 days)
MINA
MINA on 16 May 2016
Commented: MINA on 16 May 2016
Hello,
I have two subplots which need to have the same X scale but when I plot them they are different. I have attached my figure. Could someone please tell me how can I expand the x axis of the top one! Thanks

Accepted Answer

Jan
Jan on 16 May 2016
Edited: Jan on 16 May 2016
The problem is caused by automatic placement of the color bar. Set the location manually to avoid a rescaling:
subplot(2,1,1);
plot(rand(1,10));
colorbar('Position', [0.93, 0.584, 0.015, 0.341]);
subplot(2,1,2);
plot(rand(1,10));
  1 Comment
MINA
MINA on 16 May 2016
Thanks. It worked now.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!