フィルターのクリア

Contour Graph NOT Circular

8 ビュー (過去 30 日間)
Amanda
Amanda 2012 年 8 月 27 日
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]);
  1 件のコメント
Amanda
Amanda 2012 年 8 月 27 日
Yes -- Thanks for the help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by