Re scaling the axis of a figure

2 次查看(过去 30 天)
MINA
MINA 2016-5-16
评论: MINA 2016-5-16
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

采纳的回答

Jan
Jan 2016-5-16
编辑:Jan 2016-5-16
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));

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by