T O P I C R E V I E W |
Belsinga |
Posted - 05/03/2010 : 05:19:11 AM Hello,
I am just starting to become familiar with scripts in Origin. I have a little C++ and Java experience, but I just don't seem to get how to let Origin change the label of a y-axis in a graph. Could someone please send me an example; it is nowhere to be found in the help files.
Regards, B Elsinga |
2 L A T E S T R E P L I E S (Newest First) |
Belsinga |
Posted - 05/17/2010 : 09:26:54 AM thank you |
greg |
Posted - 05/03/2010 : 5:33:12 PM A Y Axis label is an ordinary text object (GraphObject class) named YL. Get the Graph, the Layer (indexed from zero in OriginC) and the name of the object and you're in business:
void set_text(string strGraph, uint iLayer, string strObject, string strText) { GraphPage gp(strGraph); if(gp) { GraphLayer gl(gp.Layers(iLayer)); if(gl) { GraphObject go = gl.GraphObjects(strObject); if(go) { go.Text = strText; } else printf("No object named %s found\n", strObject); } else printf("Layer %u not found\n", iLayer); } else printf("Graph %s not found\n", strGraph); }
set_text("Graph2", 0, "YL", "This is my Y axis");
(FYI : The example given in the GraphObject class outputs the text for YL.) |
|
|