r2018a: newer MATLAB version can't automatically determine the correct xlim and ylim for plots

1 view (last 30 days)
I have seen on other computers (running r2014,r2015a) that when you plot a graph (talking specifically about an errorbar plot), the function automatically determines the correct xlim and ylim and shows the line a little away from the axis.
But on another computer that I'm currently using (running r2018a), the generated plot results in bars kissing the y axis (i.e. xlim issue)
I have attached a generated plot and a fixed version of it (that I correct using xlim; the one I have seen other versions figure out automatically).
If there is a default setting that I'm missing, please educate me on that. If nothing, if you know, please tell me why these versions are so different. Newer versions are expected to be better, no?
Thanks!
----------------
% plotting the graph (examplot values)
meanss = [0.377 0.375 0.361];
semss = [0.008 0.008 0.008];
tt = errorbar(meanss, semss);
% changing xlim
xl = xlim;
xlim([xl(1)-0.5 xl(2)+0.5])
plots.png
  1 Comment
Pullak Barik
Pullak Barik on 25 Jun 2019
As far as I remember, even using MATLAB R2014a/R2015a sometimes gave me the worse arrangement of the axes limits, and I always used to set them manually.

Sign in to comment.

Answers (1)

Jan
Jan on 25 Jun 2019
The question is not clear, because there is no unique definition of what is "the correct xlim and ylim" value. It is a question of taste and depends on the needs. Therefore I would not dare to decide, which of the automatic limits are "better".
If you do not want the diagrams to touch the error bars, set the limits manually to the wanted values.

Community Treasure Hunt

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

Start Hunting!