Problems with quiver plot
Hey!
I try to create a quiver plot with unequl axis length. I’ like to have the arrows the same length, which somehow does not want to work.
Any ideas?
Thanks!
%% system paramters
eta = .1;
mu = .1;
nu = 1;
gamma = 2;
%% dependent variables
roi = 2;
s = linspace(max([(1-roi)*s_0,0]),(1+roi)*s_0,10);
p = linspace(max([(1-roi)*p_0,0]),(1+roi)*p_0,10);
[s,p] = meshgrid(s,p);
%% gradient flow
v = s.*p.^gamma ./ (1+(1+s).*p.^gamma);
ds = -v + eta;
dp = mu*(v – nu*p);
mag = sqrt(ds.^2 + dp.^2);
arrow_scale = 3E-1;
norm_ds = arrow_scale*ds./mag;
norm_dp = arrow_scale*dp./mag;
%% plot
q = quiver(s,p,norm_ds,norm_dp,’Autoscale’,’off’, ‘Color’,.6*[1,1,1]);
q.ShowArrowHead = ‘off’;
q.Marker = ‘.’;Hey!
I try to create a quiver plot with unequl axis length. I’ like to have the arrows the same length, which somehow does not want to work.
Any ideas?
Thanks!
%% system paramters
eta = .1;
mu = .1;
nu = 1;
gamma = 2;
%% dependent variables
roi = 2;
s = linspace(max([(1-roi)*s_0,0]),(1+roi)*s_0,10);
p = linspace(max([(1-roi)*p_0,0]),(1+roi)*p_0,10);
[s,p] = meshgrid(s,p);
%% gradient flow
v = s.*p.^gamma ./ (1+(1+s).*p.^gamma);
ds = -v + eta;
dp = mu*(v – nu*p);
mag = sqrt(ds.^2 + dp.^2);
arrow_scale = 3E-1;
norm_ds = arrow_scale*ds./mag;
norm_dp = arrow_scale*dp./mag;
%% plot
q = quiver(s,p,norm_ds,norm_dp,’Autoscale’,’off’, ‘Color’,.6*[1,1,1]);
q.ShowArrowHead = ‘off’;
q.Marker = ‘.’; Hey!
I try to create a quiver plot with unequl axis length. I’ like to have the arrows the same length, which somehow does not want to work.
Any ideas?
Thanks!
%% system paramters
eta = .1;
mu = .1;
nu = 1;
gamma = 2;
%% dependent variables
roi = 2;
s = linspace(max([(1-roi)*s_0,0]),(1+roi)*s_0,10);
p = linspace(max([(1-roi)*p_0,0]),(1+roi)*p_0,10);
[s,p] = meshgrid(s,p);
%% gradient flow
v = s.*p.^gamma ./ (1+(1+s).*p.^gamma);
ds = -v + eta;
dp = mu*(v – nu*p);
mag = sqrt(ds.^2 + dp.^2);
arrow_scale = 3E-1;
norm_ds = arrow_scale*ds./mag;
norm_dp = arrow_scale*dp./mag;
%% plot
q = quiver(s,p,norm_ds,norm_dp,’Autoscale’,’off’, ‘Color’,.6*[1,1,1]);
q.ShowArrowHead = ‘off’;
q.Marker = ‘.’; quiver, plot MATLAB Answers — New Questions









