Contour Graph NOT Circular

1 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2012-8-27
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]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by