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 properties
 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 - 12/31/2014 :  03:58:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello and very happy new year to all the team,

I am using origin 9.1 and i have two problems to solve:

1.I am plotting a graph and i want the legend generated be of the same color as that of the graph. i also want to make it bold.

2. How can i copy the desired row number data from a sheet and paste it on the graph as text. I also want to change the the properties of the pasted data and link the color to that of the graph.

Happy Christmas.

Thanks and regards,
Rajesh Agarwal

kdsaransh

India
89 Posts

Posted - 01/03/2015 :  06:13:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am still struggling for the script to work.
Go to Top of Page

AmandaLu

439 Posts

Posted - 01/04/2015 :  01:14:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi kdsaransh,

1. If you want the legend text color to be the same of the plot color, you can use
legend.color=colorindex;

To make it bold, use
legend.text$ = "\b(%(legend.text$))";


2. To add a text label linked to a specific cell and color the text, use

ncolor=3;
label -s -n MyLabel "\c$(ncolor)(%([book1]Sheet1,1,1))";// create a label named "MyLabel" and show the value in first cell of [book1]sheet1, and make it green.


Please refer to the label command document for details:

http://www.originlab.com/doc/LabTalk/ref/Label-cmd

Thanks,
Amanda

Edited by - AmandaLu on 01/04/2015 01:25:33 AM
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 04/10/2015 :  1:55:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
Thanks,

But the problem is : I have some 6 graphs each of different color and hence i have six legend. Now i want to set the legend color same as that of the graph.

I hope that's its clear.

Thanks....
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 04/17/2015 :  05:51:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I had tried ungrouping the graphs, but this didn't work at all.

Please help.

Thanks a lot..
Go to Top of Page

AmandaLu

439 Posts

Posted - 04/19/2015 :  11:27:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi kdsaransh,

You can reconstruct the legend as follow:

str$ = "";//define a blank string str$
nn = 1;
%A = %; //store "%" in %A to avoid unneeded substitution
doc -e D{
get %c -c aa; //get the color of active plot
str$ += "\l($(nn)) \b(\c$(aa)(%A($(nn))))%(CR)"; //construct the legend text of the active plot and add it to str$
nn+=1;
}
str.TrimRight(); //trim the last CR character
legend.text$ = str$; //reconstruct the legend


Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 04/20/2015 :  01:22:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Thanks ,but the problem is not solved.

For example: I have two graphs in a single layer with different color. Now the legend that is constructed has a color same as that was saved in template. But i want that the two legends created should be of same color as a that of the graph.

Thanks and regards,
Go to Top of Page

AmandaLu

439 Posts

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

I'm not sure what you really want. To my understanding, you have a graph like the following:



And you want the legend to be color as follow:



Am I right? If I misunderstood you, please let me know what you want exactly.

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 04/20/2015 :  03:08:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I am extremely sorry to get you confused.

Yes this is exactly what i want..

Thanks again....

Go to Top of Page

AmandaLu

439 Posts

Posted - 04/20/2015 :  03:12:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is exactly what my codes do...
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