Contour Plot Flow Direction
조회 수: 3 (최근 30일)
이전 댓글 표시
How can i plot a quiver plot on top of this to indicate the flow direction. The blue circles are wells and flow is supposed to go downstream.

댓글 수: 2
채택된 답변
Adam Danz
2020년 4월 15일
Follow this demo. If you get stuck, show us what you've got and we can help you get un-stuck.
댓글 수: 4
Adam Danz
2020년 4월 16일
편집: Adam Danz
2020년 4월 17일
To create a grid of quiver arrows that flow down hill rather than up hill,
% Grid interp
Xs = linspace(min(scaledwellsx), max(scaledwellsx),20);
Ys = linspace(min(scaledwellsy), max(scaledwellsy),20);
[Xq, Yq] = meshgrid(Xs,Ys);
Vq = F(Xq,Yq);
% Plot quiver grid
% Negate Vq to reverse polarity of vectors
[U,V] = gradient(-Vq);
hold on
h = quiver(Xq,Yq,U,V,2, 'k') % The 2 is a scaling factor
Notice that gradient(-Vq) reverses the direction of the arrows. You could also try gradient(1./Vq) or use quiverRotate() from the file exchange.

추가 답변 (0개)
참고 항목
카테고리
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!
