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
 Forum for Origin C
 Changing line colors in graph

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
a.abc.b35 Posted - 07/21/2011 : 2:30:45 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1
Operating System: win 7
.........
Can anyone help me with this, I am probably too lazy to look inside the wiki and find the commands for these:
I have a series of graphs. each graph has 4 sets of plots: data, multi gauss fit peak 1, multi gauss fit peak 1, multi gauss fit peak sum. Now I want a program which I can run on all these graphs (in a loop) and change the color of each sets, say, data pts are open circles of size 5 with/without error bars, multi gauss fit peak 1 is green line, multi gauss fit peak 2 is pink line, multi gauss fit peak sum is red line. Can anyone help me with that please.

AB
2   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 07/21/2011 : 11:15:16 PM
Hi AB,

From your description and the code, it seems that your graph contains only one layer. So, when using the foreach statement, you can refer to this page. And please note that, you need to use the GetType method to make sure that the page is a graph.

Penn
a.abc.b35 Posted - 07/21/2011 : 2:49:27 PM
I have got a code in the forum and modified it for the active graph layer. It seems to work for now:
#include <Origin.h>

void	ChangeColorofGrapgLines()
{
	// Create and attach a graph layer from current Graph:
	GraphLayer		gl = Project.ActiveLayer();
	if(gl)
	{
		DataPlot		dp1 = gl.DataPlots(0);	// Get the first data plot in the layer
		DataPlot		dp2 = gl.DataPlots(1);	// Get the 2nd data plot in the layer (error bar probably in my case)
		DataPlot		dp3 = gl.DataPlots(2);	// Get the 3rd data plot in the layer
		DataPlot		dp4 = gl.DataPlots(3);	// Get the 4th data plot in the layer
		DataPlot		dp5 = gl.DataPlots(4);	// Get the 5th data plot in the layer
		

		//dp1.SetColorRGB(0x00, 0xFF, 0x00, TRUE);// Set the color to green and repaint
		//dp2.SetColorRGB(0x00, 0xFF, 0x00, TRUE);// Set the color to green and repaint
		dp3.SetColorRGB(0x00, 0xFF, 0x00, TRUE);// Set the color to green and repaint
		dp4.SetColorRGB(0x00, 0x00, 0xFF, TRUE);// Set the color to blue and repaint
		dp5.SetColorRGB(0xFF, 0x00, 0x00, TRUE);// Set the color to red and repaint
		
	}
}


............
Question is : What will be the foreach statement for below :
"foreach graph (or graphlayer, am not sure) in the folder (call by given name from user)/active folder" ?

AB

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