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
Best Answer