MATLAB Answers

How to change the size of error bar?

5 views (last 30 days)
I need to change the size of the vertical line of error bar. so I dont mean the size of cap like 'CapSize',18


Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 16 Jan 2020
I am not certain what you want.
Try this:
errs = rand(1,10);
x = 1:10;
y = randi([10 20],1,10);
plot(x, y)
hold on
heb = errorbar(x, y, errs, '.');
hold off
heb.LineWidth = 2;
The error bars and the caps are both linewidth=2 here, with everything else being the default properties.


Show 3 older comments
Star Strider
Star Strider on 17 Jan 2020
It should.
Be certain you have all the updates.
To see if any updates are available, there is a bell icon in the upper right corner of the MATLAB window that is used for notifications, so see if there are any. Otherwise, if you just want to check without doing that, either click on the Add-Ons or Help buttons in the top toolstrip, and then click ‘Check for Updates’.
A Toolbox path problem is another possibility. Run these lines from your Caommand Window or a script:
rehash toolboxcache
to see if that solves the problem. If it does not, use the Contact Us telephone handset icon in the upper right corner of this page to get Technical Support.
Zeynab Mousavikhamene
Zeynab Mousavikhamene on 17 Jan 2020
I found it just change the linewitdth inside the error bar like this:
Thank you

Sign in to comment.

More Answers (0)

Sign in to answer this question.