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
 X error bars on wrong dataset
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

benlyons

UK
Posts

Posted - 12/02/2008 :  11:50:08 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 7 SR1
Operating System: Windows XP

I'm having a problem writing a LabTalk script to plot a variety of graphs with (error bars) from the same worksheet. I've been looking through LabTalk help and this forum for a long time, but can't seem to get the script to work...

I have a worksheet 'Data' with 20 columns:

"C Cerr EQE EQEerr P Perr WPE WPEerr Lum Lumerr LumE LumEerr DevE DevEerr Brt Brterr CIEx CIExerr CIEy CIEyerr"

Columns with suffix 'err' are set as error columns. C is set as an X column. All others are set as Y columns.

I'm trying to write a script which plots columns against column C, but am having trouble getting the error bars right. For example, having already opened a graph window, I execute:

layer -i Data_Brt Data_Cerr Data_Brterr;

This creates the following layer contents:
1. Data: C(X), Brt(Y)
2. Data: C(X), EQE(Y), Cerr(xEr)
3. Data: C(X), Brt(Y), Brt(yEr)

1 and 3 are OK, but I can't for the life of me figure out why it's plotting the X-error bars against a different column. In the resulting graph, the error bars don't touch the datapoints!

I have similar problems with other parts of the script. If someone can spot what I'm doing wrong in this example, I'd be very happy.

VincentLiu

China
Posts

Posted - 12/11/2008 :  03:46:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Benjamin,

Could you send your codes and .opj file to us through


http://www.originlab.com/www/company/qform.aspx?s=1&


Then we can try to solve the problem as soon as possible.

Best regards,
Vincent Liu
OriginLab Technical Services
Go to Top of Page

benlyons

UK
Posts

Posted - 01/05/2009 :  11:50:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The guys at OriginLab solved my problem after I sent them my script. In case anyone else is having similar difficulties, here's the solution:

The "Set -ox" LabTalk command does a trick to fix the script. Here, how you can use the command to specify the X Error dataset associated with a specific Y dataset:

layer -i <XErr_Dataset>; //Plot XErr ds under default column order
set <XErr_Dataset>; -ox <Y_Dataset>; //Reassociate XErr ds with specific Y ds

So in my original post, the script needs to have a line added:

layer -i Data_Brt Data_Cerr Data_Brterr;
set Data_Cerr -ox Data_Brt;
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