How to add color bar for streamslice plot?
2 次查看(过去 30 天)
显示 更早的评论
i want to know intensity of streamlines, so i need color bar for streamslice plot. can anyone help in this regard.
clc, clear, close;
X = linspace(0,1.5);
Z = linspace(-3,3);
r = linspace(0,1);
[z,x] = meshgrid(Z,X);
ui = -0.04545*x.^2.*z;
vi = x.*(-.04545 + .0909091*x.^2 + 0.04545*z.^2);
figure('units','normalized','outerposition', [0 0 1 1])
hold on
streamslice(z,x,vi,ui,'noarrows')
plot(sqrt(1-r.^2),r,'r','LineWidth',2);
plot(-sqrt(1-r.^2),r,'r','LineWidth',2);
hold off
axis image
0 个评论
回答(1 个)
Suman
2023-1-16
clc, clear, close;
X = linspace(0,1.5);
Z = linspace(-3,3);
r = linspace(0,1);
[z,x] = meshgrid(Z,X);
ui = -0.04545*x.^2.*z;
vi = x.*(-.04545 + .0909091*x.^2 + 0.04545*z.^2);
figure('units','normalized','outerposition', [0 0 1 1])
hold on
A = streamslice(z,x,vi,ui,'noarrows');
set(A,'LineWidth',2); % linewidth of streamslice line
set(A,'Color','b'); % for line color of streamslice line
plot(sqrt(1-r.^2),r,'r','LineWidth',2);
plot(-sqrt(1-r.^2),r,'r','LineWidth',2);
hold off
axis image
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Volume Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!