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!