Alter axis size

5 ビュー (過去 30 日間)
Frank
Frank 2011 年 10 月 2 日
How do I alter the size of the current axis within a figure? I've tried set(gca,'Position',[.. .. .. ..]), but the axis just disappears.

採用された回答

Jan
Jan 2011 年 10 月 2 日
Then the part "[.. .. .. ..]" moves the axes out of the visible area of the figure. It would be helpful, if you post the original command instead of masking the interesting part by dots. Try this:
figure('Units', 'pixels', 'Position', [100, 100, 600, 400]);
AxesH = axes;
pause(1);
set(AxesH, 'Units', 'pixels', 'Position', [10, 10, 200, 200]);
pause(1);
set(AxesH, 'Units', 'normalized', 'Position', [0.5, 0.5, 0.4, 0.4]);
  1 件のコメント
Frank
Frank 2011 年 10 月 2 日
Thanks. "'Units','pixels'" was what I was after.

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

その他の回答 (1 件)

Grzegorz Knor
Grzegorz Knor 2011 年 10 月 2 日
Try:
set(gca,'Units','normalized','Position',[x y w h])
where x, y, w, h belong to the interval [0 1].

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by