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.

 Réponse acceptée

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
.

2 commentaires

Catarina
Catarina le 4 Juil 2023
thank you!
Star Strider
Star Strider le 4 Juil 2023
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by