필터 지우기
필터 지우기

How to plot a ScatterPlot with different colours for each column?

조회 수: 3 (최근 30일)
Leeba Ann Chacko
Leeba Ann Chacko 2022년 9월 5일
답변: Chunru 2022년 9월 5일
I have two 2 x 40 matrices A and B.
I would like each column in A and B to have the same colour on the scatter plot (i.e only 2 points on the plot having the same colour). For some reason the colours are being repeated for multiple colums. Or perhaps these colours are different but difficult to distinguish visually.
How do I plot the data such that each column have a unique visually distinguishable colour?
A=rand(2,40);
B=rand(2,40);
scatter(A,B,'filled')

답변 (1개)

Chunru
Chunru 2022년 9월 5일
A=rand(2,40);
B=rand(2,40);
%scatter(A,B,'filled')
scatter(A', B', 'filled') % use coloumn oriented data

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by