Scaling Multiple Subplots to the Same Scale
55 ビュー (過去 30 日間)
古いコメントを表示
I have many subplots but they are different scales. How do i make them all have a y-axis from -200 to 200? Thank you. 

2 件のコメント
Walter Roberson
2020 年 9 月 4 日
If you have a vector of the handles of the axes then you can set() the YLim property of all of them.
回答 (1 件)
Bjorn Gustavsson
2020 年 9 月 4 日
編集済み: Bjorn Gustavsson
2020 年 9 月 8 日
A usefult tool to utilize for this is linkaxes - that allows you to something like this:
for i1 = 1:many
sph(i1) = subplot(many,1,i1)
plot(x,y)
end
linkaxes(sph,'y')
ax = axis;
axis([ax(1:2) -200 200])
This should keep ylims equal in all your subplots - if you modify it in one the others will follow.
HTH
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!