plotting horizontal scatter plots

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.

 採用された回答

Star Strider
Star Strider 2023 年 7 月 3 日

0 投票

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 件のコメント

Catarina
Catarina 2023 年 7 月 4 日
thank you!
Star Strider
Star Strider 2023 年 7 月 4 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by