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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 plotting of graphs and changing its colors

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
srishti0610 Posted - 07/26/2010 : 10:19:45 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 08/01/2010 : 10:27:31 PM
Maybe you can debug your script first?

Thanks
Larry

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000