Adjusting axis limits

I am trying to have the axis limits automatically adjust. I know they do by default, but they way it does it, the extreme data points are right on the edge of the plot. Is there any way to specify a margin?
I looked in axis properties but didn't see anything.

 採用された回答

Walter Roberson
Walter Roberson 2011 年 11 月 3 日

0 投票

No, there is no mechanism for specifying a margin.

3 件のコメント

Jared
Jared 2011 年 11 月 3 日
Not a huge deal, I can manually find individually the min and max x&y of each cell, then the actual min and max x&y. The only issue I run into is in finding the max. Some cells I set to Inf (as a "place holder" for my plotting operation - discussed in another question). Obviously max for those cells will be Inf. Is there a way to ignore that value and just find the max of the "real" numbers?
Walter Roberson
Walter Roberson 2011 年 11 月 3 日
max(YourData(isfinite(YourData(:)))
Or use NaN instead of inf, as max() ignores NaN.
Jan
Jan 2011 年 11 月 3 日
Exactly for this task I'm using MinMaxElem(Y, 'finite'): http://www.mathworks.com/matlabcentral/fileexchange/30963-minmaxelem .

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by