MATLAB: Does the .eps file look different from the MATLAB figure on the screen, when I have the ‘EraseMode’ property of a patch object set to ‘xor’

convertdifferentepsexportfigureMATLABpatchplotprintscreen

Why does my .eps file look different from the MATLAB figure on the screen, when I have the 'EraseMode' property of a patch object set to 'xor'?
The .eps file generated from the following code looks different from the figure on the screen:
p1=patch([4 6 6 4],[4 4 6 6],'k');
set(p1,'FaceColor',[0.85 0.85 0.85],'EdgeColor', [1 1 1]);
set(p1,'EraseMode','xor');
hold on;
plot([1:10],[1:10],'k')
print -deps temp
I have tried using different renderers. The result is same with all the 3 renderers.

Best Answer

This is a bug in MATLAB in the way that .eps files are generated from figures containing patches with the 'EraseMode' property set to 'xor'. Our development staff is currently investigating this issue.
To work around this issue, set the 'EraseMode' property to 'normal'.