Graph not large enough to contain thick line
Show older comments
The grey line here shows the average +/- one standard deviation, which is why the line is so thick. I'm trying to change the axis limits of the graph such that it can contain the whole line without it overlapping with the axes, but have so far been unsuccessful. Does anyone have a good method for this? I'm not showing any code here because this is just what it looks like with matlab's automatically generated axis limits.

6 Comments
IE
on 8 Jul 2019
Bruno Luong
on 8 Jul 2019
This will produce certainly a wrong plot, the unit of pixel; it has nothing to do with unit of y.
close all
h=plot(zeros(1,100),'LineWidth',100)

IE
on 8 Jul 2019
and the line width is (hopefully) +/- one standard deviation from that data point
It's very unlikely. As documented, the LineWidth is measured in points (= 1/72 of an inch). The acutal physical width of the line compared to other objects will therefore depends on the Units property of the figure and on the Units property of the axes. Only if both resolve to points (via explicit points or derived by normalized) will the thickness matches the standard deviation.
Star's answer is probably a lot more reliable than setting the LineWidth.
Bruno Luong
on 8 Jul 2019
"but in my particular case it's at least symmetrical"
Same for me on screen, the dissymetry comes from the figure exportation, but it still shows my point.
Accepted Answer
More Answers (1)
Bob Thompson
on 8 Jul 2019
0 votes
1 Comment
Guillaume
on 8 Jul 2019
I believe the OP generated the graph by using a very large LineWidth to plot the grey line. The auto limits for axes don't take into account line thickness, so actual limits would have to be calculated manually.
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!