How to visualize a table in a color dot plot?

4 Ansichten (letzte 30 Tage)
Joao Paulo
Joao Paulo am 13 Mai 2022
Beantwortet: KSSV am 13 Mai 2022
Hello!
I have a table with some values:
And I want to display the table in a graph like this:
Basically when the value is 0 nothing happens, when is negative is a blue dot and when is positive is a red dot.
Does anyone know how to do this?
Thanks!

Akzeptierte Antwort

KSSV
KSSV am 13 Mai 2022
Let A be your matrix.
[m,n] = size(A) ;
[X,Y] = meshgrid(1:m,1:n) ;
figure
hold on
plot(X(A<0),Y(A<0),'.b')
plot(X(A>0),Y(A>0),'.r')

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by