필터 지우기
필터 지우기

changing colours of the data points in a biplot

조회 수: 5 (최근 30일)
CLARK KENDRICK GO
CLARK KENDRICK GO 2019년 4월 16일
댓글: Heidi Hirsh 2020년 9월 29일
Suppose I have:
A = rand(100,5);
[coefs,score] = pca(A);
biplot(coefs(:,1:2),'Scores',score(:,1:2),'VarLabels',vbls);
There is a default size and colour of the data points that appear on the biplot.
I want to customise my own to show different aspects of my data. For example: I want the first 20 points to be green coloured, second 20, to be red, etc etc. How do I this?
  댓글 수: 2
Adam
Adam 2019년 4월 16일
You can use the
hPlots = biplot(coefs(:,1:2),'Scores',score(:,1:2),'VarLabels',vbls);
syntax to return the plot handles, although you get literally one handle per point on the graph so you get a large number of them that you would have to fish through and set the colours on. You can set lots of colours at a time with e.g.
set( hPlots, 'Color', 'b' )
or whatever, but you need to index only those plots you want and remove the various other lines and bits and bobs from your array of handles.
Heidi Hirsh
Heidi Hirsh 2020년 9월 29일
Can someone elaborate on how to do the indexing to select a subset of the points? I've tried doing so and the data plots in different locations if I select a subset.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by