Filter löschen
Filter löschen

How to plot quivers only on pixels with an intensity greater than 0?

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 20 Sep. 2021
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 Kommentare
Cris LaPierre
Cris LaPierre am 20 Sep. 2021
Bearbeitet: Cris LaPierre am 20 Sep. 2021
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)
Flint Marko
Flint Marko am 20 Sep. 2021
Your suggestion worked! Thanks for the help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by