Streamline Plots in MATLAB®
How to make Streamline Plots plots in MATLAB® with Plotly.
Plotly is known for its graphing libraries, but it's also a broader ecosystem for building interactive data apps, AI data analysis tools, and deploying and hosting Dash apps. Explore the full set of tools and platforms designed to help turn data into action. Discover Plotly.
Note: We are retiring documentation for R, MATLAB, Julia, and F#. Learn more about this change here.
Draw Streamlines
Define arrays x, y, u, and v.
[x,y] = meshgrid(0:0.1:1,0:0.1:1);
u = x;
v = -y;
Create a quiver plot of the data. Plot streamlines that start at different points along the line y=1.
[x,y] = meshgrid(0:0.1:1,0:0.1:1);
u = x;
v = -y;
figure
quiver(x,y,u,v)
startx = 0.1:0.1:1;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
fig2plotly(gcf);
load wind
zmax = max(z(:)); zmin = min(z(:));
streamslice(x,y,z,u,v,w,[],[],(zmax-zmin)/2)
p = plotlyfig(gcf);
for d = 1:length(p.data)
p.data{d}.type = 'scatter';
end
p.plotly;
Streamline Plot Styling
Edit, style, save, and export this streamline plot online:
https://plotly.com/9526/~jackp/