A dotted diagonal line appears when I print any annotation rectangle in MATLAB.
Example of Issue:

I am attempting to create a annotation rectangle with black face color of arbitrary size on a figure. In the MATLAB figure window, everything displays properly. When I print the figure to a pdf, a diagonal dashed line appears from the bottom left corner to the top right corner. I don't want this line to appear and would like your assistance in removing it from my pdf outputs.
Code:
h = figure( 'Units', 'inches', 'Position', [0 0 11 8.5], ...
'PaperPosition', [0 0 11 8.5], 'PaperOrientation', 'landscape', 'Resize', ...
'off','Visible','on', 'Renderer', 'painters');
a = annotation('rectangle','Linestyle', 'none', 'Units', 'inches', ...
'Position', [.25 .25 .5 .5], ...
'FaceColor', 'k', 'EdgeColor', 'none');
print(h,'temp.pdf','-dpdf','-r600', '-painters');
Thanks
pnginstead? The diagonal line seems to appear only in pdf. And for me the line is from top left to bottom right... - ThijsW'-zbuffer'removes the diagonal line for me, but adds about ten vertical lines to the rectangle. I think'-opengl'was the same, have you tried that one? It does seem to be a renderer problem, but I'm afraid there's only these three options. - ThijsW