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
 plotting non-adjacent columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tcoates

USA
1 Posts

Posted - 07/19/2006 :  8:13:18 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System:XP
Am just learning LabTalk ..i am sure this is simple ..but im stuck ...

I want to do the following:

Select an x and y column from a worksheet that are non-adjact
do a scatter plot
Smooth the plot (savitsky-golay order 3 =/-10)
get rid of the original data and display only the smoothed data.

also, the smoothed data fits in the same range -3 to +3 but the raw data doesnt. i want the plots to all have teh same x and y range .. after smoothing, the plot recalcultes and is not the same as teh template.

where i am stuck at the moment is selecting teh non-adjacted columens

worksheet -s 2 0 17 0 seemes to select all cols from 2 to 17
worksheet -p 201 pops up a dialog for me to assign the x and y cols. .. i want this to happen automatically ..

would appreciate any help ...
thanks

tom

Deanna

China
Posts

Posted - 07/19/2006 :  11:03:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Tom.

To select two columns that are not ajacent, you can use the wks.colSel(ColumnIndex). This command adds a column to the current selection. For example, you can use the following code to select Column 2 and Column 17:

wks.colSel(2);
wks.colSel(17);


If the current column selection is fine, ploting with the command

worksheet -p 201

should not cause the dialog to pop up. Please try this again.

Here is an example to perform the savitsky-golay smoothing. It assumes that the names of the X column, data column and result column are Index, Data, and Result.
curve.data$=%h_Data; 
curve.x$=%h_Index;
curve.result$=%h_Result;
curve.polydeg=3;
curve.smoothleftpts = 5;
curve.smoothrightpts = 5;
curve.smoothpts =20;
curve.SGSmooth();

I think this short script can be able to help.

In your case, I don't think plotting the original data and removing from the graph is necessary. Since we can do the smoothing on the worksheet, I think we can plot the smooth result only.

If you have any more problems, please share with us. We will be more than happy to help. :)

Deanna
OriginLab GZ Office
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