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

1 次查看(过去 30 天)
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 个评论
Pullak Barik
Pullak Barik 2019-6-25
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.

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2019-6-25
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.

类别

Help CenterFile Exchange 中查找有关 Errorbars 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by