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 of graphs and changing its colors
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

srishti0610

India
3 Posts

Posted - 07/26/2010 :  10:19:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have created a code using Labtalk which creates several plots taking data from an xls file. the plotting part of the code is working perfectly but watever changes I am trying to introduce in its font and legend , nothing is happening and its alwez giving a Command Error which I am nt able to sort out what is the error..could ne1 please help me with finding the error in the code..My code is as follows..

//This program is used for single plots


getfile -m *.xls; // get multiple ASCII *.xls data files

String nfname$,pfname$,gname$; pfname$=" ";int ij=100;int clr=1;

for(i=1;i<=count;i+=1)
{

getfile -g i;

pathnm = %[%A];//gets the pathname's length

fname$ = "%B";

%J=%[%A, pathnm-12:pathnm-4];//gets critical filename
%J=;
%K = %[%J, >'_'];//gets strings to the right of _ sign
%K=;
gname$="%K";//this is the graph name
ij=gname.GetAt(8);//ij checks if there is a character at position 8, its used to differentiate between ch301_1 and ch301_1a

types


//the following check decides if the filename is of type ch301_1 or ch301_1a
if(ij>96)
%M=%[%K,9];
else
%M=%[%K,8];

%L = %[%K, 6];%B=%L;
%B=;
string nfname$=%B;//stores new file name
gname$=%M;


//the following checks if the filename already exists then it opens and appends else creates new file
if(nfname.Compare(pfname$)==0) {save -i %(fname$);}
else {document -s;doc -n;
fname$ = "%B";}
type "%(gname$)";

win -t data; // bring up a new worksheet
open -w %A; // import the data




worksheet -s 0 0;
string bkname$ = page.name$;//active book name
string shname$ = layer.name$;//active sheet name
type "bkname";
bkname$=;

loop(ii,2,10)
{
loop(jj,13,14)
{
plotxy [bkname$]shname$!($(jj),$(ii)) plot:=200 ogl:=[gname$]1!;
}
}




win -a "%(gname$)";
legend -s;
legend.text$ = %K;
legend.background = 8;

layer.x.type = 0;
//Set the start value
layer.x.from = 0;
//Set the end value
layer.x.to = 1000;
//Set the increment value
layer.x.inc = 2;

layer.y.type = 0;
//Set the start value
layer.y.from = 0;
//Set the end value
layer.y.to = 1000;
//Set the increment value
layer.y.inc = 2;




//legendupdate mode:=dr;
//layer.x.label.pt=28;
//layer.y.label.pt=28;
//%C="%(bkname$)_B";set %C -cl clr; set %C -w 1500;





save %(fname$);type "%(fname$)";
//range aa=plotxy.ogl$;
pfname$=nfname$;//stores the previous file name for comparison
type "%(pfname$)";
if(clr>8) clr=1;
ij=0;};


please help me as i need to complete this task by today!!!

Srishti

larry_lan

China
Posts

Posted - 08/01/2010 :  10:27:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Maybe you can debug your script first?

Thanks
Larry
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