How to draw concentric arcs in a 120 degree sector and the contour plots for mass flux of water spray in each concentric compartment ?
2 ビュー (過去 30 日間)
古いコメントを表示
%% for polar plot
theta = linspace(0,120,8); % angle division
rho = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0.174300215, 0.134972129, 0.0429351, 0.015068009]; % mass flux values
polarplot(theta,rho)
%% to plot concentric arcs
n = 120;
r = 0:0.01:0.75;
r=r';
theta = pi*(0:(n))/180;
Y = r*cos(theta);
X = r*sin(theta);
plot(X,Y)
%% contour plots for mass flux density
x1 = 0.05:.10:0.75; % radius (in m) at which concentric arcs are drawn for 120 ° sector
x2 = linspace(0,120,8); % angle division
[X1, X2]= meshgrid(x1,x2);
z = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0.174300215, 0.134972129, 0.0429351, 0.015068009]; % mass flux values
figure
contourf (x1, x2, z)
0 件のコメント
採用された回答
Chunru
2022 年 4 月 12 日
編集済み: Chunru
2022 年 4 月 12 日
%% for polar plot
theta = linspace(0,120,8); % angle division
rho = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0.174300215, 0.134972129, 0.0429351, 0.015068009]; % mass flux values
polarplot(deg2rad(theta),rho) % use radian for theta
%% to plot concentric arcs
% (change the order of theta and r)
n = 120;
r = 0:0.01:0.75;
theta = deg2rad(0:n);
X = cos(theta') * r;
Y = sin(theta') * r;
plot(X,Y); axis equal
%% contour plots for mass flux density
% z = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0.174300215, 0.134972129, 0.0429351, 0.015068009]; % mass flux values
% z should be compatible with x1 and x2, e.g.
Z = sqrt(X.^2 + Y.^2);
figure
contourf (X, Y, Z); axis equal
%% For data r and z
r = [0.05, 0.15,0.25,0.35,0.45,0.55,0.65,0.75]; %sector radius
z1 = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0.174300215, 0.134972129, 0.0429351, 0.015068009];
X = cos(theta') * r;
Y = sin(theta') * r;
Z = repmat(z1, [length(theta), 1]);
figure
contourf (X, Y, Z, 5); axis equal
0 件のコメント
その他の回答 (2 件)
raghav sikka
2022 年 4 月 12 日
7 件のコメント
Chunru
2022 年 4 月 13 日
If you do want to use exactly 8 levels for the similar data you have provided, you can consider to use "patch". doc patch for more info.
The center region white gap is due to no data along that part (rho does not start from 0)
For full concentric plot, you need to make theta 360 deg. For three sectors, you can hold on and plot other two sectors on same plot.
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!