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
 Using tab names in graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

oszkoa

Hungary
47 Posts

Posted - 10/14/2011 :  09:23:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.0 SR6
Operating System: Win XP

I opened an Excel file in Origin. It has several tabs, named after the composition of the sample. In a selected tab column A contains the names of chemical elements identified in that sample, and another column contains the quantities of the respective elements. I would like to plot the quantity of the elements as a funtion of composition, i.e. the X axis would be the tab names and the different curves would be the quantity of elements, e.g. carbonm, oxygen and other.

Could anybody help me how to do that?

Thanks: OszkoA

Hideo Fujii

USA
1582 Posts

Posted - 10/18/2011 :  1:35:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi OszkoA,

To access and rearrange in such flexible way, you probably need a script or Origin C program to achieve.

If you're still in the learning process, and if you have question, maybe you can visit our LabTalk/OriginC forum.

To help you, the following is a sample of a LabTalk script which reassembles multiple worksheets in a workbook (I suggest you to import Excel book into an Origin workbook beforehand), arranges the contents in attribute-wise, then plots:
///////////////////////////////
%J=%h;  //input workbook name
range icol1=[%J]1!col(1);  //item name column
range icol3=[%J]1!col(3);  //unit column
inr1=icol1.getSize();  //number of rows
inly=page.nlayers;     //number of tabs
window -t wks;  //output worksheet
del col(2);     //initially no Y column
%K=%h;          //output workbook name
range ocol1=[%K]sheet1!col(1);

for(jj=1; jj<=inr1; jj++) {  //loop for items
  window -a %K;
  worksheet -a 1;  //add a column for next item
  kk=jj+1; //output column number
  %K!wks.col$(kk).label$=icol1[jj]$; //copy item name to LongName;
  %K!wks.col$(kk).unit$=icol3[jj]$;  //copy unit to Unit;
  for(ii=1; ii<=inly; ii++) {  //loop for tabs
    %L=%J!layer$(ii).name$;  //sheet name
    ocol1[ii]$=%L;
    range icol2=[%J]$(ii)!col(2);
    range ocolkk=[%K]sheet1!$(kk);
    ocolkk[ii]=icol2[jj];  //fill a value to output cell
  }
}
for(ii=2; ii<=kk; ii++) wks.colSel(ii,1); //highlight Y cols
run.section(Plot,3Ys_Y-YY);  //plot in 3 different scales
/////////////////////////////////////////



Hope this helps you to start working.

--Hideo Fujii
OriginLab
Go to Top of Page

oszkoa

Hungary
47 Posts

Posted - 10/23/2011 :  11:44:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo,

You are right, I am in the learning process. First I try to understand the script and then apply it.

Thanks: OszkoA
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