| Author |
Topic  |
|
|
LionAM
Germany
11 Posts |
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 |
|
|
PeterKunhardt
USA
Posts |
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. |
Edited by - PeterKunhardt on 09/29/2008 5:25:40 PM |
 |
|
|
easwar
USA
1965 Posts |
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 |
 |
|
|
LionAM
Germany
11 Posts |
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 |
 |
|
| |
Topic  |
|
|
|