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

Slapgravel

United Kingdom
9 Posts

Posted - 10/14/2015 :  04:49:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2015
Operating System: Win 7

I have some line graphs where there are many datasets on top of each other as it demonstrates the gradient of an increase of power to a system. I have used one of the colour pallets for the gradient and it looks great. However, due to how closely these lines are stacked, I have to keep the lines at 0.5 pt. The issue is that, in the legend the lines are so thin (mimicking the graph) that the colours are imperceptible when viewed on a screen at the front of the lecture theatre. Thus, I would like to thicken the lines in the legend without affecting the lines in the graph. I would like to do this without having to manually input the colours myself, as they are a stretched gradient across all lines. Thus:

/l(l x,x,x)

will not work. The legend is currently in the form of:

/l(1)
/l(2)
/l(3)
...
/l(20)

Which distributes the colours accordingly but appears to give me no control of thickness.

For what I would assume to be something that should be easy, origin apparently make it hard to find these answers.

Any help would be appreciated,

S

Shirley_GZ

China
Posts

Posted - 10/14/2015 :  06:10:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Let me show you an example to how to do this using LabTalk script:
1. Import <Origin Installation Directory>\Samples\Graphing\Group.dat inot Origin.
2. Highlight col(B)~col(D) to plot a line graph.
3. With the line graph active, open the Command window by selecting Window: Command Window. Copy and paste the script lines below to Command Window and run it:

string str$="";
int nColor = 0, nn = 1;
%A = %;
doc -e D
{
	get %c -c nColor;
	str$ += "\l(L $(nColor),10) %A($(nn))%(CRLF)"; // Change the legend Line Width to 10 and make the line color follow the plot.
	nn+=1;
}
str$ = str.Trim()$;
Legend.Text$ = str$;


Any problem, please let us know.

Thanks,
Shirley


Originlab Technical Service Team
Go to Top of Page

Slapgravel

United Kingdom
9 Posts

Posted - 10/14/2015 :  06:38:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you. It worked...I have no idea why but it did.

Is there anyway to do it without learning a scripting language?
Go to Top of Page

Zenbeggar

7 Posts

Posted - 10/28/2015 :  11:51:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Origin Version 8.6
OS Win 7

I have kind of the same problem, but a problem with grouped lines.
In my plot are 3 groups of plots each with a different palette and two single line plots whith individual colour. How do I keep the colours and change the thickness of the lines in legend? It seems that the color code extracted by get -c is wrong. For instance, it should be dark greenish, but is orange instead.

Regards,
Zen

Edited by - Zenbeggar on 10/28/2015 2:17:47 PM
Go to Top of Page

snowli

USA
1387 Posts

Posted - 10/28/2015 :  2:59:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In this case, you have to manually generate the line in legend.

If you right click legend box and choose Properties...

You can see the entries of each legend row.

\L(L Color,Thickness,Style) can be used to manually create line
see this page
http://www.originlab.com/doc/Origin-Help/Legend-ManualControl#Object_Properties_Dialog

Use Independent Symbols section

If you used some line colors not in basic color list,
You have to get the color value of your plot
One way is from Data menu, pick each plot to be active plot and then run
get %c -c nColor;
ncolor=;

put the ncolor in color part of the syntax.

Right now there is no scaling factor of line thickness or width in legend. We will try to implement some scaling factor for them.

For scatter or line+scaller plot, we do have scaling factor.
E.g.
change \l(1,s:p100) - will scale the 1st plot's symbol size in legend but will not change its shape or color.



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