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 for Programming
 LabTalk Forum
 Set Column Values on multiple Worksheets

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
LionAM Posted - 09/29/2008 : 09:53:55 AM
Hello!
I use Origin 8.
I have a Workbook with multiple similar Worksheets.
I want to add a column in each Worksheet and set
the collumn values (using one other column and the
the worksheet index).
I have no idea about Lab Talk and don't know where
to start.

My goal is to plot multiple spectra in one graph but
each should be shifted by a constant value against
the last one.

Alex
3   L A T E S T    R E P L I E S    (Newest First)
LionAM Posted - 09/30/2008 : 03:20:29 AM
Thank you, the script worked nice.

I forgot to mention that I needed
the shift in a logarithmic view,
so indeed I needed to scale by a
factor. Therefore the Stack Lines
don't work for me...

Alex
easwar Posted - 09/29/2008 : 1:08:17 PM
Hi Alex,

If you DO want to create a new column with the added offset, then you can run script such as:

// loop over all sheets in book
doc -e LW {
// Add a column
wks.addcol();
// get index of added column
int ncols = wks.ncols;
// set value of this new col to be say 10 times 2nd col
wcol(ncols) = col(2) * 10;
}


You can look at LabTalk programming help file in the product, or visit the same information (updated more often than service releases) on this wiki:
http://wiki.originlab.com/index.php?title=Category:LabTalk

Also, in the product, under \Samples\LabTalk Script Examples, there are some OGS script file examples that you can view as well.

Easwar
OriginLab
PeterKunhardt Posted - 09/29/2008 : 1:02:29 PM
Origin 8 actually has a specialized graph type that will allow you to plot several lines offset on the Y axis without performing any special computations on your data.

Assuming your worksheets have the same column short names, make sure you have no columns highlighted, open the "Plot" menu and choose "Multi-Curve > Stack Lines by Y Offsets." This will open the Plot Setup dialog. Highlight all your worksheets in the top panel and select your X and Y columns from the center panel. You can then hit "ok" and you'll see a graph with your lines stacked by a constant y offset.

If you have further questions, please feel free to contact us.

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