How to select first entry of multiple xlim
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
imagine I have subplots like
for i=1:2
ax = subplot(1,2,i)
xlim(ax(1),[0 130])
xlim(ax(2),[0 140])
end
How can I select only the first xlim entry of ax(1)? I tried this command:
x1 = xlim(ax(1),1); and several other combinations. Best regards Henrik
1 件のコメント
Jan
2017 年 11 月 15 日
The question is not clear. After ax = subplot(1,2,i), ax is a scalar, such that "ax(2)" should fail.
回答 (1 件)
Jan
2017 年 11 月 15 日
編集済み: Jan
2017 年 11 月 15 日
Perhaps you mean:
for i=1:2
ax = subplot(1,2,i)
axLim = get(ax, 'XLim');
x1 = axLim(1);
end
Or do you want to set the left X-limit keeping the automatic limit on the right?
for i=1:2
ax = subplot(1,2,i)
axLim = get(ax, 'XLim');
xlim(ax, [130, axLim(2)]);
end
参考
カテゴリ
Help Center および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
