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
 LabTalk Forum
 Variable Label Positions on Plots
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mulvenna

Germany
46 Posts

Posted - 08/07/2013 :  02:20:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mulvenna

Germany
46 Posts

Posted - 08/07/2013 :  10:20:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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!
Go to Top of Page

greg

USA
1378 Posts

Posted - 08/07/2013 :  12:11:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mulvenna

Germany
46 Posts

Posted - 08/08/2013 :  03:13:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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};}
Go to Top of Page

greg

USA
1378 Posts

Posted - 08/15/2013 :  5:01:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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