MATLAB: Problem with ‘Patch’ graphics in 2014b – Splits in two along diagonal

patchr2014bgraphics

I'm using 'Patch' to replace the boxes in box plots to change the colour etc. Code is:
h = findobj(gca,'Tag','Box');
for x=1:length(h)
boxShade=patch(get(h(x),'XData'),get(h(x),'YData'), colours(x,:), 'linestyle', 'none');
uistack(boxShade,'bottom');
end
delete(h);
This worked fine until I updated to 2014b where now the Patches appear to split in two along the diagonal, with the median in front of one half and behind the other. Example cut from exported pdf:
I am using the painters renderer as I'm outputting vector pdfs. Any ideas? I've seen some other talk that it's a bug from intersecting lines in a patch but there are no intersections here I believe as it's just a simple rectangle?
Any help greatly appreciated! David

Best Answer

The warning about DrawMode is trying to point you at the issue I described here:
I'm not sure why you're getting that message when you call the axes function. Is it possible that you have something in your startup like this?
set(0,'DefaultAxesDrawMode','normal')
If you read that blog post, you'll see that choosing the wrong value for SortMethod can result in artifacts that are similar to what you're seeing, so it would probably be a good idea to track down where that warning is coming from.
Related Question