Quiver plot arrows hidden by surface plot?
24 次查看(过去 30 天)
显示 更早的评论
Hello all,
I am creating a surface plot, and plotting on top of this a quiver plot. Everything works great, however where I have large "z" values on my surface plot, the quiver arrows are being hidden by the graph.
Any ideas how to solve this? I have attached an image of my problem, look at the yellow boxes, where the quiver arrows are hidden.
0 个评论
采纳的回答
Star Strider
2019-4-24
I was considering something like this:
x = linspace(-pi, pi, 20);
h = x(2)-x(1);
[X,Y] = ndgrid(x);
Z = sin(X) .* cos(Y);
[U,V] = gradient(Z,h,h);
W = zeros(size(U));
figure
surf(X, Y, Z)
hold on
quiver3(X,Y,Z, U,V,W, 0.7, 'r')
hold off
shading('interp')
grid on
view(0, 90)
All the arrows are visible because they all plot with respect to ‘Z’. The ‘W’ matrix simply makes them plot in a plane. (I made them red so they’re more visible.)
2 个评论
Star Strider
2019-4-24
My pleasure.
The Z-offset is simply the zeros ‘W’ matrix that effectively plots the arrows on top of the surf plot. Instead of 3D quiver arrows, the ‘W’ matrix creates the arrows as a 2D plane, however with their origins on the ‘Z’ values of the surf plot. You can see this by using the GUI (‘Tools’ -> ‘Rotate 3D’) or the view function to rotate the plot to see the arrows with respect to the ‘Z’ surface elevation. They all plot above it, regardless of where they originate.
That’s probably as well as I can explain it.
更多回答(1 个)
Thomas Rosin
2019-4-24
I don't think there are hidden, I just think your arrow size is too small.
The tip of the arrow scale with its length but it's a parameters you can set on the quiver function.
6 个评论
另请参阅
类别
在 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!