MATLAB Answers

0

Contour labels SOMETIMES disappear when plotting contour over pcolor

Asked by Kerry Bosche on 30 Jan 2015
Latest activity Answered by Chad Greene
on 30 Jan 2015
Hello,
I am plotting black, labeled contours over a pcolor plot. It works fine for some data, but for other data the labels disappear or partially disapear. I cannot find a reason based on the data itself. Any help would be appreciated. Code block below.
Kerry
<<
>>
figure
pcolor(HX,HY,crb_3d(:,:,4));
colormap(jet);
colorbar; shading interp; daspect([1 1 1]);
caxis([-100 100])
hold on
contour(HX,HY,crb_3d(:,:,3),'k','LevelList',[1 5 10 50 100],'ShowText','on');
title('Azimuth CRB minus Elevation CRB','FontWeight','bold')
axis off

  0 Comments

Sign in to comment.

1 Answer

Answer by Chad Greene
on 30 Jan 2015

This is sometimes a result of the figure renderer acting funny. Try cycling through the different renderers to see if any of these solutions work
set(gcf,'rend','painters')
If that doesn't work,
set(gcf,'rend','opengl')
And if that doesn't work,
set(gcf,'rend','zbuffer')
And if that still doesn't work, force the contours on top of everything by using contour3 with a Z variable made up of ones(size(Hx)).

  0 Comments

Sign in to comment.