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
 Origin Forum
 Displaceable labels

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
LIMHP Posted - 11/22/2005 : 11:45:17 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows XP

Hello,
I am trying to create moveable labels to attach to axes (both X and Y) for a set of graphs. This set of graphs is controlled by one worksheet, and the graphs depend on some parameters (alpha, beta, gamma). These parameters are available in the worksheet. What I would like to achieve are specific labels added to several places along the X- and Y- axes, according to some functions of (alpha, beta, gamma). The Custom label menu only provides the possibility for one label, defined by the user at a specified location, but I cannot get this location to be a function of worksheet data. Another idea was to create text or graphic boxes and to add those to the graphs, using the 'Scale' function to have them at a particular location, but once again I could not get this location to be dependent on worksheet data. Lastly, maybe a script could do the trick, but I have no experience in such scripting and would thus be looking for example of scripts either adding labels to axes or positioning text boxes onto a graph.
Thanks for any help anybody could provide,
AM.
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 11/22/2005 : 2:58:25 PM
I'll go with your last approach. Assume your alpha, beta and gamma values are in column C and you want to add a label along the left Y axis at Y=alpha (row 1). Run this script while the graph is active...

%W = %[%C,'_']; // get wks name from active dataset name
yy = %W_C[1]; // value in col C, row 1
%Z = $(yy); // label text (yy as string)
%B = label1; // label name
label -s -n %B %Z; // create text label
%B.y = yy; // center label at Y=yy
%B.x = X1; // center label at left Y axis (X=X1)
%B.x -= %B.dx/2; // offset by half the label width
%B.x -= (X2-X1)/100; // offset by additional 1% of X range (adjust to suit)

You can create and position multiple text labels by giving each a unique name. For example, this will create labels from rows 1, 2 and 3 of column C.

%W = %[%C,'_'];
loop (i,1,3) {
yy = %W_C[i];
%B = label$(i);
label -s -n %B $(yy);
%B.y = yy;
%B.x = X1;
%B.x -= %B.dx/2;
%B.x -= (X2-X1)/100;
};

Once you know a label's name you can adjust other properties such as font size and color. See your programming guide for details...

LabTalk Language Reference > Object Reference > Internal Object Overview > User-created Visual Objects

Mike Buess
Origin WebRing Member

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