color contour different then pcolor

8 Ansichten (letzte 30 Tage)
Matthias Pospiech
Matthias Pospiech am 15 Feb. 2012
I am using pcolor together with contour lines. However the value of the lines can no be identified from the plot, as can be seen in the following code
[x y data] = peaks(1000);
data = data / max(max(data));
colorDepth = 1000;
colormap(jet(colorDepth));
hold on;
pcolor(x,y,data); shading flat;
[C,hfigc] = contour(x, y, data,[0:0.1:1]);
set(hfigc, ...
'LineWidth',1.0, ...
'Color', [1 1 1]);
hold off;
hcb = colorbar('location','EastOutside');
I would rather want the pcolor to be in gray values and he contour lines in colors. However then I need a legend for the contour lines as well.

Akzeptierte Antwort

Matthias Pospiech
Matthias Pospiech am 22 Feb. 2012
The question was answered on stackoverflow.com.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by