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
 Columns as legends
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Apoorva Fedelmid

23 Posts

Posted - 02/22/2023 :  05:25:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!

snowli

USA
1381 Posts

Posted - 02/22/2023 :  08:48:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

Apoorva Fedelmid

23 Posts

Posted - 02/22/2023 :  09:13:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

ChaoC

USA
166 Posts

Posted - 02/22/2023 :  1:25:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

snowli

USA
1381 Posts

Posted - 02/24/2023 :  08:34:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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