Problem with contour function: the linecolor disappeared

2 views (last 30 days)
Hi everyone, I met a problem with contour function.
%%f3 is a calculated martix
figure(1)
contour(kx_grid,ky_grid,f3,10,'linewidth',2);
k_contour = 2*pi.*(kx_grid.^2+ky_grid.^2).^(-0.5);
figure(2)
contour(kx_grid,ky_grid,f3,10,'linewidth',2);
hold
k_contour = 2*pi.*(kx_grid.^2+ky_grid.^2).^(-0.5);
[C,h]=contour(kx_grid,ky_grid,k_contour,[50 100 200 400 800],':k','LineWidth',1,'LineStyle','--');
clabel(C,h,'color','r');
end
the results are
The linecolor of Figure 2 disappeared, can anyone tell me how to retain the color while plot the second contour. Thanks in advance!

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!