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
 Renaming the short name on a graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gledger

1 Posts

Posted - 02/21/2011 :  07:12:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.5 and Service Release (Select Help-->About Origin): SR0
Operating System: Windows 7

I have set up a loop for plotting multiple curves on 1 graph object which is labelled by default as graph1.

win -t plot line; //Generates the graph
loop (ii, 2, $(numFile)/2+2)
{
plotxy iy:= [Dbk$]Dwks$!(1,$(ii)) plot:=200 ogl:=[Graph1]1!
}; //Plots curves on the graph

This works fine but when I come to plot a new set of data it fails unless I manually rename the graph (as it uses Graph2 as a default name).

Is there a way of renaming the short name which I can tag onto the end of the script to save me manually renaming the graph every time?

Any help would be much appreciated.
Gary.

easwar

USA
1965 Posts

Posted - 02/21/2011 :  2:37:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gary,

The Graph window will be active after your "win -t" statement, so when using plotxy you don't have to specify window name, you can change your code to be like this:

plotxy iy:= [Dbk$]Dwks$!(1,$(ii)) plot:=200 ogl:=1!;


This will add the plot to 1st layer of active window, which will be your graph window.

Also, when you issue win -t, right after that statement you can get and save the %h variable which will have window name, if you want to use the name later for some reason such as not reliable to assume active graph.


win -t plot line; //Generates the graph
string mygraph$ = %h; // get and save window name;
loop (ii, 2, $(numFile)/2+2)
{
plotxy iy:=[book1]sheet1!(1,2) plot:=200 ogl:=[mygraph$]1!;
} //Plots curves on the graph


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