xlim command changes the axis limit of the figure.
How can i also limit data that is contained by the figure?
Appearently, even though xlim is applied data is still there.

 採用された回答

Ali Ozdagli
Ali Ozdagli 2013 年 11 月 13 日

0 投票

cleanfigure.m file from matlab2tikz can take care of this issue.

その他の回答 (1 件)

Wayne King
Wayne King 2013 年 11 月 8 日
編集済み: Wayne King 2013 年 11 月 8 日

0 投票

If when you say limit data, you mean restrict the range of data values, then use ylim
x = randn(100,1);
plot(x);
set(gca,'xlim',[1 25],'ylim',[-1 1])

1 件のコメント

Ali Ozdagli
Ali Ozdagli 2013 年 11 月 9 日
no data range is not what i am asking.
let's say i have a data set of 5000 elements. but only 1500 elements are shown in the figure. still when i save this figure, it will still contain data that is not shown in the figure.

サインインしてコメントする。

カテゴリ

質問済み:

2013 年 11 月 8 日

回答済み:

2013 年 11 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by