How to add color bar for streamslice plot?

조회 수: 1 (최근 30일)
Jagadeesh Korukonda
Jagadeesh Korukonda 2022년 7월 11일
답변: Suman 2023년 1월 16일
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

답변 (1개)

Suman
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

카테고리

Help CenterFile Exchange에서 Volume Visualization에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by