Quiver plot when axes scale are too different result in very ugly plots
27 次查看(过去 30 天)
显示 更早的评论
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!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/809904/image.jpeg)
0 个评论
回答(1 个)
Chunru
2021-11-23
编辑:Chunru
2021-11-24
load("quiverPlotVariables.mat")
whos
% 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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!