Axis labels cover the figure

Hi there,
While making my figure, I noticed how the Yaxis labels cover part of the figure. How do I fix this?
f1=figure;
p = plot(xArray,normalizedSum);
p.LineWidth = 1.2;
p.Color = [175 0 50]./255;
set(gca,...
'FontSize', 12,...
'XDir','reverse',...
'YMinorTick','on',...
'YScale','log',...
'YTickLabelMode', 'manual',...
'YGrid','on',...
'YMinorGrid','on',...
'YMinorTick','on',...
'YTick',[1 10 100 200 255],...
'YTickLabel',{'1','10','100','200','255'});
xlim([0 12]);
ylim([0 255]);
ylabel('Logarithmic pixel intensity');
xlabel(['Distance (' char(197) ')']);
Thanks in advance.

 Accepted Answer

Star Strider
Star Strider on 9 Feb 2021
This is a bug that has since been fixed. See semilogx() with reverse X Axis changes Y Labels position for a work-around, or update your version to the latest update (that may have fixed it), or upgrade to the current version/release or a version after R2018b (that may have been the last version with this bug).

4 Comments

And thus comes the moment I have been postponing for quite some time, i.e. updating the software. Thanks for your anwser. After the installation, I can accept your answer, but I have no doubt it is correct.
My pleasure!
Thank you!
Works perfectly in R2020b. Thanks @Star Strider.
As always, my pleasure!

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!