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 row of worksheet data to make XY plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

carat64

USA
Posts

Posted - 10/26/2004 :  4:31:04 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 6.1
Operating System: Windows XP

Hi,

I have a large worksheet of XYY... data and I want to plot a specific row of the data as a separate XY plot. The Y columns of the original worksheet are separated by known times (indicated in the column label but increments are not the same between each column) and this information would then be the "X" in the new XY plot.

How could I easily extract this data from my worksheet?

thanks,
Cara

easwar

USA
1965 Posts

Posted - 10/26/2004 :  5:14:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Cara,

Copy and paste the following lines of code to your script window, then highlight all lines, and hit enter to execute. Make your source worksheet the active page before running the code. The 3rd row from your source worksheet will be extracted - this number 3 is hard coded here. You can change as needed. Also you can look up LabTalk help to see how you can place this code in an OGS script file section and call it from script window, in which case you could pass a parameter for desired row, rather than hard coding it.

Easwar
OriginLab


// Save name of active sheet to variable %a
%a = %h;
// Get number of columns in active sheet;
icols = %a!wks.ncols;
if( icols < 2 ) return;
//
// Create a new worksheet
win -t;
// Loop over all columns of source worksheet...
irow = 1;
for( ii = 2; ii <= icols; ii++ )
{
// Get label string of current column from source wks
%b = %a!wks.col$( ii ).label$;
// Place label in 1st col of new wks
%( %h, 1, irow ) = %b;
// Place value from "3rd" row of source wks into 2nd column of new wks
%( %h, 2, irow ) = %( %a, ii, 3 ); // change 3 to desired row number of source sheet
// Look in LabTalk help files on how to pass row num as argument to an OGS section
irow++;
}




Edited by - easwar on 10/26/2004 5:15:43 PM
Go to Top of Page

carat64

USA
Posts

Posted - 10/26/2004 :  6:08:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Excellent! Thank you Easwar!!!
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