The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 color change in PCA
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

xianqian1219

USA
3 Posts

Posted - 08/11/2015 :  4:10:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi there,

I am a beginner on Origin. I am now performing a PCA on a large set of data. It turns out that all the data points are in the same color. How do I change the colors into groups, e.g. divide all the data points into small subgroups with each subgroup has their own color?

Thank you very much for your help.

Xianqian

xianqian

jasonzhao

China
262 Posts

Posted - 08/11/2015 :  10:55:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Which kind of PCA graph do you like to have multiple color?

Do you want graph like this?



Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 08/11/2015 10:55:54 PM
Go to Top of Page

xianqian1219

USA
3 Posts

Posted - 08/12/2015 :  11:49:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by jasonzhao

Hello,

Which kind of PCA graph do you like to have multiple color?

Do you want graph like this?



Best regards!
Jason
OriginLab Technical Service




Hi Jason,

Thank you very much for your response. Yes, the one you showed here is what I want. I would really appreciate it if you can give me more directions.

Thanks.

Lin
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 08/12/2015 :  11:11:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

To create the graph shown above, you shall
1. copy data of PC1 and PC2 to another sheet, from the 'Score Data Sheet'. add an extra column beside the column B, right click the column and select Set Column Values, enter the formula in input dilaog, change the recalculate mode to menu, click OK to apply.

((col(b)<i>!=0))?1:col(c)



2. make a Sctter plot with the new book (Book1), double click the scatter th open the plot properties, change the color into Col(C), click OK.
Active the graph, Select Gadget: Cluster to open the gadget, then select the region you want to change color, click Mask button

3. Active the work sheet, click the yellow lock on the top right corner of column and select Recalculate.
4. Active the graph again,click unmask button, move the region to next parts of the graph, click Mask again,
then change the formula in Set value dialog into:

((col(b)<i>!=0))?3:col(c)

5. Active the graph again,click unmask button, move the region to next parts of the graph, click Mask again,
then change the formula in Set value dialog into:

((col(b)<i>!=0))?4:col(c)

Active the graph again,click unmask button

You can continue to set more color in this way, the finished graph will be like this.




Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 08/12/2015 11:19:25 PM
Go to Top of Page

xianqian1219

USA
3 Posts

Posted - 08/13/2015 :  6:16:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jason,

Thanks again for your help. But what you showed here is to change color directly on the score plot itself. The problem is that I have a large set of data and they all spread out and overlapped. So it is hard for me to select a perfect region to cover the desired data points. What I want to do here is to set the color for groups before the score plot is generated, if that's possible. Using the example you gave me, what I want is as following. No.1-6 is the first subgroup and color it black, No.7-11 color it green and No.12-16 color it red. Hope I made myself clear enough. Is there any way to make this work?

Thank you very much.

Lin
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 08/13/2015 :  10:06:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please set the column(C) in this way:

(i<=6)*1+(i>6&&i<=11)*2+(i>11)*3


Then also set col(C) as symbol color for column B as mentioned above.

Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 08/16/2015 9:29:42 PM
Go to Top of Page

Echo_Chu

China
Posts

Posted - 08/18/2015 :  11:04:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Xianqian

I am wondering whether you already have group column in your source data?

If yes, you can just copy and paste your group column next to the data for score plot and make the score plot color index to the column

The steps can be as below

1. Add a new column to sheet Score Data
2. Copy and paste the group column there
3. Single click on the Score Plot on result sheet to open the embedded graph
4. Double click on the score plot to open the Plot Details dialog
5.Select Symbol tab in the right panel. Set Symbol Color index to the new group column, column G as the image below



Echo
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000