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
 Forum for Origin C
 how to access plotting parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

olsy

29 Posts

Posted - 10/19/2011 :  10:45:29 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): pro8.5
Operating System: Win7

hi to everybody!
Again the problem appeared in my first program in Ogirin C.
I am trying to build 6 graphs. Till now Ive found only one way to do it and use it but I still need to define some parameters as legend, line color and thickness, symbol type, scale number size and so on...
This is the code i use for plotting:

Worksheet wksdata("[Sun-Results.xls]Statistics");
   GraphPage gp;
gp.Create("Origin");
 
while(gp.Layers.Count() < 6)
{
    gp.AddLayer();
}
 
graph_arrange_layers(gp, 3, 2);
// Add XY data from worksheet to graph each layers

int index = 4;
foreach(GraphLayer gl in gp.Layers)
{
    DataRange dr;
    dr.Add(wksdata, 1, "X");
    dr.Add(wksdata, index+1, "Y");
    
    if( gl.AddPlot(dr, IDM_PLOT_LINESYMB) >= 0 )
        gl.UngroupPlots(0);  // ungroup plots
    	gl.Rescale();
    
    index++;

}


How i can improve it with all plotting settings and maybe separate them and get plots one by one?

Penn

China
644 Posts

Posted - 10/19/2011 :  10:00:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can refer to the following examples: Legend Update, Line Plot, Symbol Plot, Plotting, and Graphing.

Penn
Go to Top of Page

olsy

29 Posts

Posted - 10/20/2011 :  10:17:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Penn! Helped a lot )
but i still have not find how to change the size of X and Z Axis numbers. I would like to increase them from 18 to 36 Point...and the same with Legend letters size.

Do you maybe have an idea?
Go to Top of Page

Penn

China
644 Posts

Posted - 10/20/2011 :  10:17:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use Tree Format to set the size of X and Z axes' labels. If you don't know the format tree of the axis, see this example.

About the size of legend, actually, the legend is graph object, you can refer to this page.

The following example shows how to change the size:

void changeSize()
{
	GraphLayer gl = Project.ActiveLayer();
	if(!gl)
		return;
	
	Axis aX = gl.XAxis;  // x axis
	Axis aZ = gl.ZAxis;  // z axis
	
	if(!aX || !aZ)
		return;
	
	Tree trXFormat, trZFormat;
	trXFormat.Root.Labels.BottomLabels.Font.Size.nVal = 36;  // set X axis label size
	trZFormat.Root.Labels.FrontLabels.Font.Size.nVal = 36;  // set Z axis label size
	
	int nXErr = aX.UpdateThemeIDs(trXFormat.Root);
	int nZErr = aZ.UpdateThemeIDs(trZFormat.Root);
	if((nXErr == 0) && (nZErr == 0))
	{
		aX.ApplyFormat(trXFormat, true, true);
		aZ.ApplyFormat(trZFormat, true, true);
	}
	
	GraphObject goLegend = gl.GraphObjects("Legend");  // get the legend
	if(!goLegend)
		return;
	
	Tree trLegendFormat;
	trLegendFormat.Root.Font.Size.nVal = 36;  // set size
	if(0 == goLegend.UpdateThemeIDs(trLegendFormat.Root))
		goLegend.ApplyFormat(trLegendFormat, true, true);
}


Penn
Go to Top of Page

olsy

29 Posts

Posted - 10/24/2011 :  09:31:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Penn!
I got what i was need )
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