Borrar filtros
Borrar filtros

Contour Graph NOT Circular

8 visualizaciones (últimos 30 días)
Amanda
Amanda el 27 de Ag. de 2012
I'm trying get a basic circular temperature contour graph.
Instead, I'm getting a straight line and doesn't resemble at all to
MATLAB's examples for contour maps. I want 4 circular zones
representing 90 degrees, 80 degrees, 70 degrees, and 60 degrees.
Here is my code:
long = [0 1 2 3; 4 5 6 7; 8 9 10 11; 12 13 14 15];
lat = [15 16 17 18; 19 20 21 22; 23 24 25 26; 27 28 29 30];
temp = [98 95 94 92; 85 82 81 80; 72 75 74 71; 65 62 61 69];
figure;
contour(long,lat,temp,4)
Thanks,
Amanda

Respuesta aceptada

Image Analyst
Image Analyst el 27 de Ag. de 2012
You mean something like this?
clc; % Clear the command window.
workspace; % Make sure the workspace panel is showing.
format longg;
format compact;
fontSize = 20;
angularZones = 16;
radialZones = 10;
r = (0: radialZones)'/ radialZones;
theta = 2*pi*(-angularZones : angularZones) / angularZones;
X = r*cos(theta);
Y = r*sin(theta);
% Make up some random temperatures.
for rr = 1 : length(r)
for aa = 1 : length(theta)
temperatures(rr, aa) = 9*rr + rand;
end
end
pcolor(X,Y, temperatures)
axis equal tight
colorbar
grid on;
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
title('Temperatures', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
  1 comentario
Amanda
Amanda el 27 de Ag. de 2012
Yes -- Thanks for the help.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by