How can I keep the yaxis label inside rather than outside
4 ビュー (過去 30 日間)
古いコメントを表示
How can I keep the yaxis label inside rather than outside
0 件のコメント
回答 (2 件)
Davide Masiello
2022 年 10 月 17 日
編集済み: Davide Masiello
2022 年 10 月 17 日
You could play around with the "Position" field of the text structure of the label.
See below
plot(1:10,1:10)
xlabel('xlabel')
yl = ylabel('ylabel');
yl.Position
plot(1:10,1:10)
xlabel('xlabel')
yl = ylabel('ylabel');
a = gca;
a.YRuler.TickLabelGapOffset = -15;
% yl.Position = [1 5.5000 -1];
2 件のコメント
Davide Masiello
2022 年 10 月 17 日
Other possibility, a bit cumbersome I'd say
plot(1:10,1:10)
xlabel('xlabel')
ylabel('ylabel')
a = gca;
a.YTickLabels = {''};
a.YLabel.String = {''};
axis([0 11 0 11])
t1 = text(0.025*diff(a.XLim)*ones(10,1),(1:10)',num2cell(1:10));
t2 = text(0.075*diff(a.XLim),5.5,'Ylabel');
t2.Rotation = 90;
t2.HorizontalAlignment = 'center';
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!