Quiver plot when axes scale are too different result in very ugly plots

31 Ansichten (letzte 30 Tage)
Axel Wong
Axel Wong am 23 Nov. 2021
Kommentiert: Chunru am 24 Nov. 2021
Hey. I am trying to make a nice-loking quiver plot, but because the axes are in different scales the quiver plot looks very messy. My specific problem is that
1). The arrow heads look wide open and assymetrical.
2). The lengths of the arrows are all normalized to 1, but yet some do look much longer than others due to the different axes scales.
The attached figure can be reproduced by typing
quiver(log10(VN),PSIN,vdot,psidot,0.5)
where the relavant variables are attached in the .mat file below. I have already tried a variety of things including the "quiverInLogScale.m" and "arrow3.m" File Exchange functions, but neither seem to help. Thank you so much for any help!

Antworten (1)

Chunru
Chunru am 23 Nov. 2021
Bearbeitet: Chunru am 24 Nov. 2021
load("quiverPlotVariables.mat")
whos
Name Size Bytes Class Attributes PSIN 10x10 800 double VN 10x10 800 double ans 1x48 96 char psidot 10x10 800 double vdot 10x10 800 double
% You need to scale the vdot and/or psidot so that they are representing
% the true orientation of the vector. Assume that vdot and psidot has same
% unit, then you can chek a squared size area, eg. x=[-9:-8.5] and y=[0.64
% 0.68], which is approximately a square. The ratio of width to length is
% thus 0.5/0.02=25
quiver(log10(VN), PSIN, vdot, 25*psidot, 0.2)
% Perhaps a better method is to use the index as x- and y-axis
% Don't know the meaning of your variable. Assume that vdot and psidot
% give the correct direction (meaning same unit).
%
[m, n]= size(VN);
[xx, yy] = meshgrid(1:n, 1:m);
figure;
quiver(xx, yy, vdot, psidot, 0.5);
axis equal
% Then you can change the x- and y- ticklabel to whatever you want.
  2 Kommentare
Axel Wong
Axel Wong am 23 Nov. 2021
Hey Chunru,
Thanks for your answer. However, it seems your vectors are still of different lengths. Do you know if it's possible to just plot an arrow of equal size at the meshgrid grid points (here the end of the arrow stem)? I know in my case it's impossible to get a nice-looking figure if I still want to incorporate a sense of magnitude to the lengths of my vectors (as their magnitudes are several orders of magnitudes different) so I am willing to just show their directions.
Thanks!

Melden Sie sich an, um zu kommentieren.

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!

Translated by