Is it possible to make larger gap between xlabel and the x-axes?
72 ビュー (過去 30 日間)
古いコメントを表示
How to set the gap/space between x or y legends and axes?
0 件のコメント
回答 (2 件)
Jos (10584)
2015 年 5 月 29 日
編集済み: Jos (10584)
2015 年 5 月 29 日
You can use SET and GET:
xh = get(gca,'xlabel') % handle to the label object
p = get(xh,'position') % get the current position property
p(2) = 2*p(2) ; % double the distance,
% negative values put the label below the axis
set(xh,'position',p) % set the new position
3 件のコメント
Jos (10584)
2015 年 6 月 6 日
編集済み: Jos (10584)
2015 年 6 月 6 日
Try another value than 2, like p(2) = 1.1 * p(2)
Lars Abrahamsson
2020 年 9 月 28 日
Even very small movement might go out of the picture:
clear all
close all
TestX = randn(1,10);
TestY = randn(1,10);
X = cumsum(TestX);
Y = cumsum(TestY);
figure
plot(X,Y)
xlabel('balle')
ylabel('bolle')
figure
plot(X,Y)
xlabel('balle')
ylabel('bolle')
xh = get(gca,'xlabel') % handle to the label object
p = get(xh,'position') % get the current position property
p(2) = - 0.1 + p(2) ; % double the distance,
% negative values put the label below the axis
set(xh,'position',p) % set the new position
For example.
Is there nothing that can be doune against it?
Tongyao Pu
2019 年 11 月 23 日
Maybe it is too late for your problem, but another way could be just adding an extra blank line:
title({'the title you want to add',' '})
2 件のコメント
Enrico Maria Turco
2020 年 12 月 27 日
yl=get(gca,'ylabel');
pyl = get(yl,'position');
pyl(1) = 1.05*pyl(1);
set(yl,'position',pyl)
Note that a minor change of 0.05 might be sufficient to have enough space.
参考
カテゴリ
Help Center および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!