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
 Columns as 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
Apoorva Fedelmid Posted - 02/22/2023 : 05:25:15 AM
In Origin, columns are often denoted as A(X1), B(Y1), C(X2), D(Y2), where two columns form a pair of X/Y-data.


Is it possible, to use the number of the column as legend? For example, the data in A(X1)/B(Y1) should be labeled as "1", the data in C(X2)/D(Y2) as "2" etc.?

Thank you!
4   L A T E S T    R E P L I E S    (Newest First)
snowli Posted - 02/24/2023 : 08:34:48 AM
Just FYI, we also jiraed this in ORG-26599 so more options are supported such as this column designation index, plot index, group name/layer name of plot can show in legend in the coming Origin 2023b.

Thanks, Snow
ChaoC Posted - 02/22/2023 : 1:25:29 PM
Hello,

You can run this LabTalk script to set your data labels in the Comments row:

for(i=2;i<=wks.ncols;i=i+2){ //indexes each Y column in the Comments row
	wcol(i)[C]$=$(i/2);
}

Then you can click the Legend Mini toolbar and select Data Plot Legend Translation Mode and specify the Comment row, as Snow suggested.

If you want to apply this to all workbooks and worksheets in your project file, use this script:

doc -e W{ //loops through all workbooks in the project
	doc -e LB{ //loops through all worksheets for the selected workbook	
		for(i=2;i<=wks.ncols;i=i+2){
			wcol(i)[C]$=$(i/2);
		}
	}
}


Best,
Chao
Apoorva Fedelmid Posted - 02/22/2023 : 09:13:08 AM
Hellow snowli,
I appreciate the answer. However, I was looking for an easier solution, because sometimes I have up to 100 cycles, which I do not want to label manually.
snowli Posted - 02/22/2023 : 08:48:29 AM
Is it OK that you put such 1, 2 in column label rows e.g. long name, comments, or even user defined rows?

Then u can click legend object. Mini toolbar will show next to it.
Choose Data Plot Legend Translation Mode to specify Comment, Long Name, etc. to use as legend.

Thanks, Snow


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