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
 Incrementing Symbol Shapes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CrazyBignate

USA
4 Posts

Posted - 07/09/2010 :  11:19:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release 8.1:
Operating System: Windows XP

This seems like it should be easy, but I have been struggling with this now for a couple days. I currently have multiple scripts working which allow the user to import a set of different data books and then run a script, which graphs each one in the same plot and layer all in one color. The can be repeated with different colors etc. all added to the same layer in the same plot.

I would also like symbols to increment with each set of data plotted. I have tried iterating an integer and using the "set" command but I have had no luck.

My newest idea was to group each set and then figure out how to increment the symbol shape per group... not sure if this is a correct approach, need help!

Here is a portion of my code for one of the graphs:

//// Auxilary Voltage Shift vs. Frequency Shift ///////

// Point to the graph layer
range L1 = [Graph1]1!;

int black=1;
// Loop over all sheets in all books
doc -e LB {

// Check to see if workbook, so can leave out matrix books
if(2 == exist(%h,2))
{
// Declaring ranges
range rx=col(Q);
range ry=col(R);

// Use plotxy X-function to add plot to specified layer
plotxy iy:=(rx,ry) plot:=201 color:=black size:=5 ogl:=L1;

}
};


// Can use legend update XF so legend shows data range for example;
win -a Graph1;
legendupdate mode:=dr;

/////////////////////////////////////////////////////////////////////

Any help is greatly appreciated. Thanks!

Penn

China
644 Posts

Posted - 07/13/2010 :  02:06:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Do you mean that for each time you plot xy-data, you want to set both colors and symbols to increment? If so, you can try the following script, in which I have made a little change.

// Point to the graph layer
range L1 = [Graph1]1!;

int incColor=1;  // color increment
int incShape=1;  // symbol increment
int incCurrentPlot=1;  // set current plot

// Loop over all sheets in all books
doc -e LB 
{
	// Check to see if workbook, so can leave out matrix books
	if(5 != exist(%h))
	{
		// Declaring ranges
		range rx=col(A);
		range ry=col(B);
		// Use plotxy X-function to add plot to specified layer
		plotxy iy:=(rx,ry) plot:=201 color:=incColor size:=15 ogl:=L1;
		
		win -a Graph1;  // activate Graph1
		layer.plot = incCurrentPlot;  // set the newly created plot active
		set %C -k incShape;  // change the symbol of the active plot
		
		incColor++;  // next color
		incCurrentPlot++;  // next plot
		incShape++;  // next symbol
	}
};
// Can use legend update XF so legend shows data range for example;
win -a Graph1;
legendupdate mode:=dr;


Penn
Go to Top of Page

CrazyBignate

USA
4 Posts

Posted - 07/15/2010 :  10:51:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks much!
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