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
 Y-axis label

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
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.)

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