plotting horizontal scatter plots

5 visualizzazioni (ultimi 30 giorni)
Catarina
Catarina il 3 Lug 2023
Commentato: Star Strider il 4 Lug 2023
Hello,
How can i display scatter points horizontally in a horizontal bar plot? Like, instead of having the scatter plot plotting from the x axis, making it plot from the y axis.

Risposta accettata

Star Strider
Star Strider il 3 Lug 2023
Reverse the ‘x’ and ‘y’ coordinates in the scatter plot —
x = 1:5;
y = rand(size(x));
figure
barh(rand(size(x)))
hold on
scatter(y, x, 100, y, 'filled', 'p')
hold off
.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by