MATLAB: Quiver plot arrows hidden by surface plot

quiversurfaceplot

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.

Best Answer

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.)