How to get quiver plot with gradient color
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
clc
clear;
sys = @(~,x) [-3*x(1)+3*x(2);-2*x(1)+x(2)];
syms r j
space = 1.5;
[r,j] = meshgrid(-4:space:4,-4:space:4);
dr = -3*r + 3*j;
dj = -2*r + j;
drn = dr./sqrt(dr.^2+dj.^2);
djn = dj./sqrt(dr.^2+dj.^2);
q = quiver(r,j,drn,djn,0.5);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1189058/image.jpeg)
How could i change the color of this quiver plot to gradient color like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1189063/image.png)
Thanks alot <3
0 Kommentare
Antworten (1)
DGM
am 11 Nov. 2022
Bearbeitet: DGM
am 11 Nov. 2022
This isn't something that can be done directly with the quiver object.
There is a FEX tool that can do a colormapped quiver plot. That may work depending on your needs.
There are also these much older tools, but they may have problems in current MATLAB versions. I have not tested them, but they all predate R2014x.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Vector Fields finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!