How to plot quivers only on pixels with an intensity greater than 0?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to quantify the direction of my quiver plot, but quivers stemming from pixels with an intensity of 0 tend to skew the data. Therefore, I want to stop quivers from being plotted on pixels with an intensity of 0.
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 9월 20일
quiver will not plot nan, so a simple solution may be to replace any value of 0 with nan.
U(U==0)=nan;
V(V==0)=nan;
quiver(X,Y,U,V)
댓글 수: 3
Cris LaPierre
2021년 9월 20일
편집: Cris LaPierre
2021년 9월 20일
That was an example of how to get quiver to not draw vectors that met some underlying condition. You can use the variable containing intensity values (which should be the same size as U and V).
U(intensity==0)=nan;
V(intensity==0)=nan;
quiver(X,Y,U,V)
추가 답변 (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!