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
 Help: Labtalk access to plot details?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

redman

UK
59 Posts

Posted - 03/23/2010 :  6:59:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.0SR6
Operating System: XP

Is it possible to access the plot details by labtalk scripts? For example for grouped datasets in a graph, to change the plot type from scatter to line scatter, change the fill color (or line/border color) from "color list basic" to "color list default".


Thanks a lot.

larry_lan

China
Posts

Posted - 03/25/2010 :  10:46:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

You can try the set command. See this example.

Larry
Go to Top of Page

redman

UK
59 Posts

Posted - 03/26/2010 :  06:43:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, but it make no sense. The set command can only affect one dataplot each time. My purpose is to change their properties of grouped dataplots with preset schemes (line/symbol scheme, color scheme...)

Wish greg or cpyang could give an answer.

Thanks a lot.

Edited by - redman on 03/26/2010 06:54:18 AM
Go to Top of Page

greg

USA
1378 Posts

Posted - 03/29/2010 :  10:03:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You are correct that most of the SET commands work only on individual datasets not in a group, however the line connection method can be used to change a group Scatter plot into a group Line+Symbol plot with:
set %C -l 1;
This is a legacy of the fact that Line, Line+Symbol and Scatter are all Line+Symbol where Scatter has no line connection and Line has zero symbol size.

You can then use the themeApply2g X-Function to apply a Theme to your graph as in:
themeApply2g theme:="Color List Default";

For any more, LabTalk does not have access to everything you want, for which you would need OriginC. In general, we recommend that you create pre-defined graph Templates. Another option is to Ungroup and then use the SET command on each dataplot.
layer -gu; // Ungroup the plots in the current layer
Go to Top of Page

redman

UK
59 Posts

Posted - 03/30/2010 :  5:52:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Greg, thanks a lot. Nevertheless, your answer is quite helpful.
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 01/18/2015 :  11:12:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Suppose i have three graphs in a single layer and so after ungrouping the plots using layer -gu; command, how can i individually change their properties.

Thanks
Go to Top of Page

Shirley_GZ

China
Posts

Posted - 01/19/2015 :  03:41:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

To customize the properties of each data plot individually using LabTalk, please refer to the below help pages:

http://www.originlab.com/doc/LabTalk/guide/Formatting-Graphs#Data_Plot_Properties

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

Additionally, you can use below script to change the active data plot:
layer1.plot = 2; //Activate the second plot in layer1

http://www.originlab.com/doc/LabTalk/ref/Layer-obj

Thanks,
Shirley

Originlab Technical Service Team

Edited by - Shirley_GZ on 01/19/2015 04:28:42 AM
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 01/19/2015 :  04:42:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Thanks, I tried the set command , but i still have a small problem. I am not able to individually change the properties because I am not able to make active the other graph.

Thanks again.


Go to Top of Page

Shirley_GZ

China
Posts

Posted - 01/19/2015 :  05:14:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use below script to change the active data plot:
layer1.plot = 2; //Activate the second plot in layer1


http://www.originlab.com/doc/LabTalk/ref/Layer-obj

Originlab Technical Service Team
Go to Top of Page

HelenSingleton

USA
1 Posts

Posted - 02/10/2015 :  11:41:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use the set command. See this example.

Helen
Go to Top of Page

Stulle

Germany
1 Posts

Posted - 09/20/2017 :  06:44:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
All previous answers are pointing in the rigth direction, but I had to do much trial and error to come finally to this code:

// activate the graph window. This is even needed if you plotted it in preceding code.
window -a Graph10000;
// An object handle is required, unfortunately you can`t do [Graph10000]layer1!plot = 1 directly.
range lay1 = [Graph10000]layer1!;
// chose the curve dataset to be activated (1 is the first plotted curve).
lay1.plot = 1;
// set color of activated dataset, where %C represents the activated curve dataset
set %C -c color(Red);
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