print ignores z order of stacked contours
이전 댓글 표시
Hi there,
suppose the following MWE:
A = peaks(10);
A(A<0) = nan;
contourf(A, 50, 'linecolor', 'none');
colormap(flipud(gray));
The problem now is, that one cannot distinct between the background of the contour and the surface of the contour since it is white on white. Hence, I want a frame around the surface but without the contour lines:
A = peaks(10);
A(A<0) = nan;
contourf(A, 'linewidth', 2);
colormap(flipud(gray));
hold on;
contourf(A, 'linecolor', 'none')
hold off;
This renders nice on screen with the expected result. When I now save the picture with
print(gcf, '-painters', '-r300', '-dpng', 'peaks.png');
or '-zbuffer' or '-opengl' (it doesn't make a difference), the contourf lines and the first contour show up on top:

Any idea how to fix that? As mentioned, I tried printing with '-zbuffer' and '-opengl' with no luck. I also tried to reorder using uistack, still with no luck. I'm stuck.
Sincerely
Florian
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
