how can I give arrow to a particular color in MATLAB?

9 次查看(过去 30 天)
I have this image
I want to plot the arrow with the color bar, let suppose there is blue colour only so that denote this blue color by an up arrow at a particular direction.
like this, can I do this in matlab?

回答(1 个)

Image Analyst
Image Analyst 2023-1-21
Did you try annotation?
figure
plot(1:10)
x = [0.3 0.5];
y = [0.6 0.5];
annotation('textarrow',x,y,'String','y = x ', 'Color', 'b', 'LineWidth', 3)
  6 个评论
SAHIL SAHOO
SAHIL SAHOO 2023-1-21
can you please give me some documentation regarding to this?
Image Analyst
Image Analyst 2023-1-21
help quiver
QUIVER Quiver plot. QUIVER(X,Y,U,V) plots velocity vectors as arrows with components (u,v) at the points (x,y). The matrices X,Y,U,V must all be the same size and contain corresponding position and velocity components (X and Y can also be vectors to specify a uniform grid). QUIVER automatically scales the arrows to fit within the grid. QUIVER(U,V) plots velocity vectors at equally spaced points in the x-y plane. QUIVER(U,V,S) or QUIVER(X,Y,U,V,S) automatically scales the arrows to fit within the grid and then stretches them by S. Use S=0 or S='off' to plot the arrows without the automatic scaling. QUIVER(...,LINESPEC) uses the plot linestyle specified for the velocity vectors. Any marker in LINESPEC is drawn at the base instead of an arrow on the tip. Use a marker of '.' to specify no marker at all. See PLOT for other possibilities. QUIVER(...,'filled') fills any markers specified. QUIVER(AX,...) plots into AX instead of GCA. H = QUIVER(...) returns a quivergroup handle. Example: [x,y] = meshgrid(-2:.2:2,-1:.15:1); z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15); contour(x,y,z), hold on quiver(x,y,px,py), hold off, axis image See also FEATHER, QUIVER3, PLOT. Documentation for quiver doc quiver

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by