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
 LabTalk Forum
 Variable Label Positions on Plots

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
Mulvenna Posted - 08/07/2013 : 02:20:12 AM
Hi,

Im working on a script that plots four graphs and exports them to two pdfs. There are standard labels (legend, title, logo, etc.) on the pdf.

Though I was hoping to include labels that print just beside the final point of each line on the graph, indicating which line is which. This brings about the problem that every time the graph is plotted the labels' positions will be different.

If anyone had any suggestions as to how this could be done (or if it just can't be done) it would be much appreciated.

Thanks :)
Mulvenna
4   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 08/15/2013 : 5:01:11 PM
If you do NOT declare your variables (and also do not enumerate X and Y since they are reserved) then you can do something like:
loop(ii,1,max)
{
thisX$(ii) = something ... ;
thisY$(ii) = something ... ;
etc.
}
and that will create variables named
thisX1, thisY1
thisX2, thisY2
up to
thisXmax, thisYmax
Mulvenna Posted - 08/08/2013 : 03:13:43 AM
Thanks greg, you're a great help!!

Still getting used to the software.

One other thing though, is there any chance you know how I could create a loop, that each time it goes round it gives a new variable (x1, x2, x3, x4...)

at the minute I'm using seperate loops for each:

for (i=1; i<= wks.maxrows; i++)
{if (col(C4)[i]!=NULL)
{x1=(col(C3)[i])+0.15;
y1=(col(c4)[i]+0.05);}
else {Break};}

for (i=i+1; i<= wks.maxrows; i++)
{if (col(C4)[i]!=NULL)
{x2=(col(C3)[i])+0.15;
y2=(col(c4)[i]+0.05);}
else {Break};}

for (i=i+1; i<= wks.maxrows; i++)
{if (col(C4)[i]!=NULL)
{x3=(col(C3)[i])+0.15;
y3=(col(c4)[i]+0.05);}
else {Break};}
greg Posted - 08/07/2013 : 12:11:56 PM
You just have to make sure to name your label when you create it. You can then access all its properties:

label -a 2.2867 1.0461 -b 4 -n MyLabel \b($(spd1));
MyLabel.FSIZE = 32; // Set font size in Pts
MyLabel.COLOR = color(blue); // Set color
MyLabel.BACKGROUND = 1; // Turn on border
Mulvenna Posted - 08/07/2013 : 10:20:59 AM
I think I,ve got it, it will have to do anyway. But I'm stuck on something extremely basic now, can anyone tell me how I can change the font size in this label????

window -a %(bkname$);
double x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14;
double y1,y2,y3,y4,y5,y6,y7,y8,y9y10,y11,y12,y13,y14;

for (i=1; i<= wks.maxrows; i++)
{if (col(C4)[i]!=NULL)
{x1=(col(C3)[i-1])+0.25;
y1=(col(c4)[i-1])-0.0625;}
else {Break};}


window -a %(gr2name$);
label -a 2.2867 1.0461 -b 4 \b($(spd1));

......
...


Everything I've tried just isnt working :/

Thanks!

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