How to set different marker for some different values?

2 ビュー (過去 30 日間)
Habib
Habib 2020 年 8 月 9 日
回答済み: KSSV 2020 年 8 月 9 日
Hi,
I have a 2D matrix. I want to set different markers for some different values. How it possible?
for example: x=linspace(1:10); y=rand(1,10);
I want to set: square mark for x(1) and y(1); and circle mark for x(2) and y(2) and so on.

採用された回答

KSSV
KSSV 2020 年 8 月 9 日
fmt = {'*','o','^','.','+','x','s','p','h'}; % different markers
x = 1:9 ;
y = rand(size(x)) ;
figure
hold on
for i = 1:9
plot(x(i),y(i),fmt{i}) ;
end
Read about gscatter, scatter.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by