Thread Subject: Disappearing contour labels

Subject: Disappearing contour labels

From: Jana Houser

Date: 24 Nov, 2009 20:08:20

Message: 1 of 2

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!

Subject: Disappearing contour labels

From: someone

Date: 24 Nov, 2009 21:06:20

Message: 2 of 2

"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'.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com