print ignores z order of stacked contours
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
