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
 Origin Forum
 combining layer legends

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
ringman7677 Posted - 03/09/2004 : 12:21:47 PM
Is there an easy way to create one legend that contains all of the layers of a plot?
7   L A T E S T    R E P L I E S    (Newest First)
ringman7677 Posted - 03/12/2004 : 5:04:22 PM
Looks like I need Origin 7.5
rdremov Posted - 03/09/2004 : 6:02:23 PM
In Origin 7.5 there is a simple GUI option "Include All Data Plots in Legend" available in PlotDetails dialog, Legend tab.

Thanks,
Roman.
Mike Buess Posted - 03/09/2004 : 3:36:18 PM
This will work in Origin 7.0 and 7.5. (Don't know about earlier versions.)

loop (ii,1,page.nlayers) {
if(ii==1) %L=Layer 1;
else %L=%L
Layer $(ii);
lay -o ii {
%Z=""; lay -c;
loop (jj,1,count) {
%L=%L
\l($(ii).$(jj)) %($(ii).$(jj));
};
};
};
label -s -n legend %L;

Mike Buess
Origin WebRing Member
Mike Buess Posted - 03/09/2004 : 3:05:38 PM
quote:
The final legend uses the linetype/color for all the lines in the legend based on the layer selected before running the script
I can't reproduce that. All lines/symbols/colors fit the individual plot types/colors.

...Now I see what you're saying and see no way around it. \l(n) can only refer to one layer at a time.

quote:
Also, can a return be put in so they are stacked in the legend?


They should be stacked as the script is written now. For example,

%L=%L
Layer $(ii); // adds a return before appending Layer $(ii) to %L.

%L=%L Layer $(ii); // puts everything in the same line.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/09/2004 3:15:25 PM
Mike Posted - 03/09/2004 : 2:58:08 PM
Note that you can do this through the user interface, too (assuming that you are using Origin 7.5).

For information, see the Origin Help file (Help: Origin) and search for the topic "Displaying Data Plots from Different Layers in One Legend."

Mike Genthner
Documentation Specialist
OriginLab
ringman7677 Posted - 03/09/2004 : 2:41:35 PM
Thanks for the script. It has one glitch. The final legend uses the linetype/color for all the lines in the legend based on the layer selected before running the script. Also, can a return be put in so they are stacked in the legend?

Edited by - ringman7677 on 03/09/2004 2:44:37 PM
Mike Buess Posted - 03/09/2004 : 12:55:25 PM
loop (ii,1,page.nlayers) {
if(ii==1) %L=Layer 1;
else %L=%L
Layer $(ii);
lay -o ii {
%Z=""; lay -c;
loop (jj,1,count) {
%L=%L
\l($(jj)) %[%Z,#jj];
};
};
};
label -s -n legend %L;

That will put the full dataset names in the legend. If you just want the names you usually see in the legend replace %[%Z,#jj] with %(jj).

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/09/2004 1:07:42 PM

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