Is there any way to hide the overflow so that the lines don't protrude from the frame as in the attached image?
plot(sin(0:0.1:10),"LineWidth",10)
You can set the axes clipping style to rectangle
plot(sin(0:0.1:10),"LineWidth",10);
set( gca, 'ClippingStyle', 'rectangle' );