From: Li on
I am plotting a vertical distribution of water temperature, and want to add a thermocline at the temperature of 20 oC. Below is my code:

[C, h] = contourf (X, Y, Z, [0: 0.1: 30], 'LineStyle', 'none' ); %X Y Z are gridded data.
hold on;
[C2, h2] = contour (X, Y, Z, [20 20], 'k-', 'linewidth', 2);
fill ( Distance2, Depth2, [0.7 0.7 0.7] );

I do not want to show plots deeper than the ocean floor, so I am using 'fill' to cover it up. My question is why the 'fill' function can cover anything from the 'contourf' plot, but not the line plotted from 'contour'?

Thank you.
From: Li on
I found the answer:

set(gcf, 'renderer', 'painters');


"Li " <liqingjiang(a)gmail.com> wrote in message <i0fo3g$t6i$1(a)fred.mathworks.com>...
> I am plotting a vertical distribution of water temperature, and want to add a thermocline at the temperature of 20 oC. Below is my code:
>
> [C, h] = contourf (X, Y, Z, [0: 0.1: 30], 'LineStyle', 'none' ); %X Y Z are gridded data.
> hold on;
> [C2, h2] = contour (X, Y, Z, [20 20], 'k-', 'linewidth', 2);
> fill ( Distance2, Depth2, [0.7 0.7 0.7] );
>
> I do not want to show plots deeper than the ocean floor, so I am using 'fill' to cover it up. My question is why the 'fill' function can cover anything from the 'contourf' plot, but not the line plotted from 'contour'?
>
> Thank you.