How can I prevent Y axis exponential from overlapping with the plot?

On my loglog plot with a reversed x axis, the y axis labels are positioned incorrectly. Messing with OuterPosition and Position doesn't seem to help, and TightInset is locked. Any ideas? Thanks in advance!

 采纳的回答

I could reproduce that behaviour in R2018b. This is obviously a bug.
Try this:
x = logspace(-4, 2, 25); % Create Data
y = logspace(0, 10, 25); % Create Data
figure
loglog(x, y)
Ax = gca;
Ax.XDir = 'reverse';
yt = Ax.YTick; % Get ‘YTick’ Values
Ax.YTickLabel = compose('10^{%d} ', log10(yt)); % Create New ‘YTickLabel’ Cell Array, Adding End Spaces
Creating your own tick labels and adding spaces at the end appears to work:

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息

产品

版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by