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

kdsaransh

India
89 Posts

Posted - 04/19/2015 :  12:44:14 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi ,

I am using origin 9.1

I have a graph having two layer. I can change the color of the layer independently but cannot modify the individual legends. Both the legends are changed together. I don't know whats wrong.
I am using the below code:

layer -gu;

layer1.plot = 1; //Activate the first plot in layer1
set %C -c color(blue);
legend.fsize = 28;
legend.color = color(blue);

layer1.plot = 2; //Activate the first plot in layer1
set %C -c color(cyan);
legend.fsize = 20;
legend.color = color(cyan);

SeanMao

China
288 Posts

Posted - 04/20/2015 :  02:49:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

"Legend" object controls the properties of all legend entries rather than individual ones.

You can only set the text color for each legend entry through substitution notation as following:

layer -gu; 

layer1.plot = 1; //Activate the first plot in layer1
set %C -c color(blue);

layer1.plot = 2; //Activate the second plot in layer1
set %C -c color(cyan);

legend.fsize = 28; // Set Legend entry text size
Legend.text$="\l(1) \c4(%(1))"+ char(10)$+"\l(2) \c5(%(2))"; // Set legend entry color


where syntax \cColor Index is used to color each legend entry.

You can use color(blue)=; to check the color index of color blue. \c4() is to color as blue, \c5() is to color entry as cyan.

Legend entry color to follow data plot color is a feature will be implemented in our next release Origin 2016.

Regards!

Sean

OriginLab Tech. Service


Go to Top of Page

kdsaransh

India
89 Posts

Posted - 04/20/2015 :  03:04:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot....
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