MATLAB Answers

How do i represent a set of clusters points in scatter plot?

조회 수: 53(최근 30일)
dear experiences
i have dataset which has been clusters using k-means and stored in an excel file (clu.xlsx) , my data consist from 200 observations where :
first column is observation labels second column is x data values third columns is y data values fourth columns is cluster ids ( 1,2,3...K "clustering has done using k-means") and : cent= stored the centroids of my clusters
my question :
  1. - how do i can plot observation in scatter plot where i would like colored every points in cluster with different colors from other in other clusters.
  2. - then how to plot centroids also.
thanks for any suggestion

  댓글 수: 0

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

채택된 답변

Massimo Zanetti
Massimo Zanetti 10 Feb 2017
Hi, what you need is exactly Matlab GSCATTER function. Check out the help page.

  댓글 수: 3

ahmed obaid
ahmed obaid 10 Feb 2017
Thanks, suppose 50 points belong to cluster1, 40 points to cluster2, 25 points to cluster3, 80 to cluster4.. so i need to represent all points first along with their centroids, then every cluster points has a certain colors, for example points which belong to cluster 1 has red color, points in cluster2 has blue color and so on.. so is this possible please ?
Massimo Zanetti
Massimo Zanetti 10 Feb 2017
Yes, it is possible. The help page shows you how to do it. Please read it. Try to modify examples therein to suit your case.
If you find this answer helpful, please accept it.
ahmed obaid
ahmed obaid 10 Feb 2017
thanks, i'm reached to my goal

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

추가 답변(1개)

ADRIAN RADILLO
ADRIAN RADILLO 12 Mar 2017
Hi. How can I use gscatter for 3D scatter plots? I know the function scatter3, but unfortunately the function gscatter3 DOESN'T exist. Could you help me please?

  댓글 수: 0

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


Translated by