|
"Jana Houser" <jblbryn@ou.edu> wrote in message <hehefk$1fm$1@fred.mathworks.com>...
> Hi all you cyber Matlabers,
>
> I have a question. I'm trying to generate a plot that has a colored scalar field with vectors and contours over it. I'm using the pcolor and contour functions. The plot is coming out fine, but my contour labels are not showing up, even when I try using the 'manual' option. Here's my code:
>
> [X,Y]=meshgrid(0:0.5:50,0:0.5:12);
>
> %Specify the values w will be contoured at
> ContPos=[0;5;10;20];
> ContNeg=[-20;-10;-5];
>
> figure(1)
> pcolor(X,Y,Reflectivity1)
> shading flat
> caxis([0, 55])
> colorbar
> xlabel('Y km (N/S) 1 grid point = 500 m')
> ylabel('Height 1 grid point =500 m')
> title('Vertical x-section: Reflectivity with vertical velocity contours')
> hold on
> quiver(X(1:25,1:4:101),Y(1:25,1:4:101),UY1(1:25,1:4:101),WY1(1:25,1:4:101), 2, 'k')
> [C1,h1]=contour(X,Y,WY1,ContPos,'k');
> clabel(C1,h1,'LabelSpacing',288);
> [C2,h2]=contour(X,Y,WY1,ContNeg,'--k');
> clabel(C2,h2,'LabelSpacing',288);
> hold off;
>
> Any ideas? Thanks so much!
I tried to run your code, but I get:
??? Undefined function or variable 'Reflectivity1'.
|