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
 Incrementing Symbol Shapes

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
CrazyBignate Posted - 07/09/2010 : 11:19:16 AM
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!
2   L A T E S T    R E P L I E S    (Newest First)
CrazyBignate Posted - 07/15/2010 : 10:51:38 AM
Thanks much!
Penn Posted - 07/13/2010 : 02:06:40 AM
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

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