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 for Programming
 LabTalk Forum
 Set Column Values on multiple Worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LionAM

Germany
11 Posts

Posted - 09/29/2008 :  09:53:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

PeterKunhardt

USA
Posts

Posted - 09/29/2008 :  1:02:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Edited by - PeterKunhardt on 09/29/2008 5:25:40 PM
Go to Top of Page

easwar

USA
1965 Posts

Posted - 09/29/2008 :  1:08:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

LionAM

Germany
11 Posts

Posted - 09/30/2008 :  03:20:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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