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

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?

Answers (1)

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 Comments

I think you didn't get my point, maybe because my question wasn't clear
how can I attain this?
It's the figure that's not clear. Too tiny to resolve. Plus, this is a different picture than the original.
If annotation doesn't do it then perhaps quiver will.
how can i add quiver in this any idea?
I assume you have the coordinates of the spots on the circle perimeter. That can be where the tails of hte arrow are. Then you need to give coordinates of the arrow head. Then pass in all the coordinates in to quiver. quiver undoubtedly has sample code.
can you please give me some documentation regarding to this?
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

Sign in to comment.

Categories

Tags

Asked:

on 21 Jan 2023

Commented:

on 21 Jan 2023

Community Treasure Hunt

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

Start Hunting!