How can I modify this contour plot and add arrows?
Show older comments
So I currently have this:
x=0:0.01:1.5;
y=0:0.01:1.5;
T1=100;T0=0;
[X,Y]=meshgrid(x,y);
Z=(T1-T0)*2.*X.*Y+T0;
[cs1,h1]=contour(X,Y,Z,'LevelList',T0:25:T1)
clabel(cs1,h1)
hold on
Z2=(T0-T1).*(X.^2-Y.^2);
[cs2,h2]=contour(X,Y,Z2,'LineColor','#EDB120','LevelStep',10)
The first contour are the isotherms; which is already done and finished.
The second contour are the flow lines, and I want to add small arrowheads on them to indicate the direction. Another thing is that I want to do is to erase the part not needed (in this case above T1 and below T0. How can I do this?
3 Comments
Image Analyst
on 18 Mar 2022
Here is the visualization you forgot to post:
x=0:0.01:1.5;
y=0:0.01:1.5;
T1=100;T0=0;
[X,Y]=meshgrid(x,y);
Z=(T1-T0)*2.*X.*Y+T0;
[cs1,h1]=contour(X,Y,Z,'LevelList',T0:25:T1)
clabel(cs1,h1)
hold on
Z2=(T0-T1).*(X.^2-Y.^2);
[cs2,h2]=contour(X,Y,Z2,'LineColor','#EDB120','LevelStep',10)

I believe you can add arrowheads with the annotation() or quiver() functions.
Michael
on 18 Mar 2022
Accepted Answer
More Answers (0)
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
