Hi, i got some issues with labeling the contourlines on a surface plot. Plotting the attached data leads to a nice surf plot with contour lines. But unfortunately the labels of the contour3 plot hide behind the surface plot. Setting 'FaceAlpha' of the surf plot to 0 shows the labels. But I would like to see the surface and all labels of the contour3 plot. What am i missing? Can someone please help!
Thanks a lot!
if true
% load test data
load('PlotData.mat');
% new figure & axes
f = figure;
ax = axes(f);
set(f,'Renderer','openGL');
hold(ax,'on');
% surf plot
surfPlot = surf(ax,X,Y,Z);
% surf options
surfPlot.FaceColor = 'interp';
surfPlot.LineStyle = 'none';
surfPlot.FaceAlpha = 1;
% Zmax for Zlim (inc 0.1)
maxZint = max(max(Z))*10;
maxZ = ceil(maxZint)/10;
% contour3 plot
[C,h] = contour3(ax,X,Y,Z,[0:0.1:maxZ 0:0.1:maxZ],'k','ShowText','on','LineWidth',1);
% labels on contour3
clabel(C,h,'FontSize',11,'Color',[0 0 0]);
% view
view(ax,[-37.5 30]);
end

 채택된 답변

Jan Scheuermann
Jan Scheuermann 2018년 7월 6일

1 개 추천

I got the perfect answer from Ol1v3r in the german gomatlab forum. just wanted to share with you ...
if true
ax.SortMethod = 'childorder';
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

제품

릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by