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
 Origin Forum
 Plotting one column of different worksheets into one graph window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a_user

USA
0 Posts

Posted - 08/20/1998 :  7:01:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a small problem which I am sure can be solved with LabTalk quite easily
but I couldn't figure out how:
I have a project with several worksheets, all containing the same type of data.
(The worksheets all have different names). Now I want to plot one column
against
another (which is *not* set as X) for every worksheet and have the plots all in
one graph window (one layer). I already figured out that I could use

doc -e W {}

to cycle through all the worksheets. My problem is that I can't use

layer -i dataset

because then the dataset is plotted against the worksheet's X column. How can I
explicitly state which column should be plotted against which?

Thanks for any help
(BTW, I would appreciate a quick reply... I got to have this done very soon!)

Cheers
Bernd

a_user

USA
0 Posts

Posted - 08/20/1998 :  7:03:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Response

There is a way to do this using the set -x command. You can plot your Y data
against it's default X column and then change the X dataset after it is plotted
in the layer. Please see the following simple script:

Assumptions:
1. The graph window is active when the script is executed.
2. You are plotting the second column in each worksheet.
3. Data1_a is the X dataset that we will associate with each Y dataset.

%W=%H; //Store the Graph window name
doc -e W {
%B=%(%H,2); //Set %B to the second column in each wks
win -o %W {
layer -i %B; //Include the dataset in the layer
set data1_a -x %B; //Associate data1_a as the X dataset for %B
};
};
rescale;

In the future, if you require a rapid technical response, please submit your
technical question to your Origin dealer if they provide technical support. Or
you can mail us directly at tech@microcal.com.

Go to Top of Page

a_user

USA
0 Posts

Posted - 08/20/1998 :  7:05:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, this worked just fine

I tried your suggested script and it basically is what I was looking for...
I couldn't find the rescale command in the documentation though. Did I miss
it or is it not documented?

Thanks again
Bernd

Go to Top of Page

a_user

USA
0 Posts

Posted - 08/20/1998 :  7:08:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Rescale macro

"Rescale" is a built-in Origin macro. It is very simple; it is defined to
rescale the axes by executing the layer -a command.
You can find out how macros are defined by typing into the Script Window:
define macroname;

For example, if you type:

define rescale;

You will see:

{
layer -all
}

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