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

조회 수: 13 (최근 30일)
SAHIL SAHOO
SAHIL SAHOO 2023년 1월 21일
댓글: Image Analyst 2023년 1월 21일
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