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
 Dataset order in 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

peter.cook

UK
356 Posts

Posted - 08/05/2004 :  5:06:53 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I would like to be ab le to check the order of datasets in a plot (labtalk pref but c would do) and then alter it. Even if i can just send one dataset to the 'top'.

Any ideas?

Cheers,

pete

Mike Buess

USA
3037 Posts

Posted - 08/05/2004 :  7:37:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

You can read the current order with 'lay -c', which counts the plots and lists the dataset names in the string variable %Z...

%Z=""; lay -c;
count=; // how many datasets are plotted?
COUNT=3
%Z=;
(Data1_B) (Data1_C) (Data1_D)

Now reverse the plot order (this is the only built-in reordering command that I know of)...

lay -r;
%Z=""; lay -c; %Z=;
(Data1_D) (Data1_C) (Data1_B)

Next, move Data1_D to the 'bottom'...

lay -e Data1_D; // remove Data1_D from layer
lay -i Data1_D; // plot it again (as last dataplot)
%Z=""; lay -c; %Z=;
(Data1_C) (Data1_B) (Data1_D)

Finally, move Data1_B to the 'top' (somewhat more complicated)...

%Z=""; lay -c; // list all data plots to %Z
lay -e %Z; // remove all plots from layer
lay -i Data1_B; // plot Data1_B first
loop (i,1,count) {
%A=%[%Z,#i]; // plot remaining datasets
if(%A!="Data1_B") lay -i %A;
};
%Z=""; lay -c; %Z=;
(Data1_B) (Data1_C) (Data1_D)

I'm not sure if the last two 'moves' will preserve the plot types and colors but you get the idea. Once you know the names of the current datasets you can replot them in any order you want.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/05/2004 7:42:44 PM
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