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!
