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
 Renaming the short name on a graph

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
gledger Posted - 02/21/2011 : 07:12:22 AM
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.
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 02/21/2011 : 2:37:21 PM
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



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