I'm using 64 bit matlab r2010a on windows 7 (this may be relevant if this is an obscure rendering bug)
this is apparently a bizarre bug that manifests itself when the text interpreter is latex
set(0, 'DefaultTextInterpreter', 'Latex');
this code will produce a blue box with a black border and a legend outside the axes
cla reset;
patch ([0.5 0.5 0.75 0.75 0.5], [0.5 0.75 0.75 0.5 0.5], 'b', 'FaceAlpha',1);
xlim([0 1]);
ylim([0 1])
legend ('blah', 'Location', 'bestOutside')
If I change the code, so that the patch has a non-opaque alpha value,
cla reset;
patch ([0.5 0.5 0.75 0.75 0.5], [0.5 0.75 0.75 0.5 0.5], 'b', 'FaceAlpha',0.5);
xlim([0 1]);
ylim([0 1]);
legend ('blah', 'Location', 'bestOutside')
I get an empty black box instead of a filled one, and an axes resized correctly to place a legend outside but no legend.
The patch also disappears if I run all the code up to legend, then click "edit plot" on the figure menu. The patch does not reappear after I uncheck "edit plot". The figure and axes properties (using get(gcf) and get(gca) respectively) are identical before and after clicking and unclicking "edit plot"
Resizing the figure window does not cause the patch to disappear. Resizing the axes from the command line:
p = get(gca, 'Position');p(3) = p(3)/2;set (gca, 'Position', p)
does not cause the patch to dissapear.
I have tried setting opengl to hardware and software mode (using opengl hardware, opengl software) and found no difference.