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
 All Forums
 Origin Forum
 Origin Forum
 Using row of worksheet data to make XY plot

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
carat64 Posted - 10/26/2004 : 4:31:04 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
carat64 Posted - 10/26/2004 : 6:08:53 PM
Excellent! Thank you Easwar!!!
easwar Posted - 10/26/2004 : 5:14:45 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000