Superimpose a quiver plot on top of a picture
이전 댓글 표시
Hi,
I want to superimpose vector field on top of a TIFF figure!! my vector fields are in '.struct' format, but apparently the vectors are always appear below the figure!! Does anyone know why this happen? & how to superimpose a quiver plot onto a figure?! Here is my code: close all clear all
U=load('VelU - 5m1p2s1.mat');
W=load('VelW - 5m1p2s1.mat')
img = imread('fc2_save_2014-11-17-213936-0000.tif');
imagesc(img);
hold on;
X = U(1,1).x(20:1:64,20:1:64);
Y = U(1,1).y(20:1:64,20:1:64);
Velu = U(1,1).u(20:1:64,20:1:64);
Velw = W(1,1).w(20:1:64,20:1:64);
quiver(X,Y,Velu,Velw, 'y','linewidth',2);
채택된 답변
추가 답변 (1개)
Chad Greene
2014년 12월 31일
Sometimes stacking gets a little confused, especially depending on the renderer and Matlab distribution. You can try
h = quiver(X,Y,Velu,Velw, 'y','linewidth',2);
uistack(h,'top')
or place the arrows at a higher z value with quiver3 like this:
quiver3(X,Y,ones(Velu),Velu,Velw,zeros(Velu) 'y','linewidth',2);
댓글 수: 1
Chad Greene
2014년 12월 31일
Oops, that should be
quiver3(X,Y,ones(size(Velu)),Velu,Velw,zeros(size(Velu)) 'y','linewidth',2);
카테고리
도움말 센터 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!