Setting patch transparency in MATLAB changes line markers, messes up plot

Thursday, July 10, 2014

I'm using the boundedline function from File Exchange to create error bounds for 2 of 5 lines on a plot. All of these lines have a marker on them.

When I change the alpha value of the shaded regions created with the boundedlines function, it screws up the look of all of the lines. The marker face color seems to go "underneath" the line itself, so the line just crosses through the box marker, like a strike through. Its tough to describe but I think it has something to do with the renderer struggling with the transparencies or something...

p = plot(times,[Bias5; Bias10; Bias20; Bias30; Bias40; Bias50],'LineWidth', 2 , 'Marker', 's','MarkerFaceColor', 'w');

[b,c] = boundedline(times(5:11),Bias20(5:11),std(Bias20Ens), 'r', times(5:11),Bias5(5:11),std(Bias5Ens), 'b', 'alpha');