Author |
Topic |
|
sudd0030
11 Posts |
Posted - 01/26/2016 : 6:40:36 PM
|
Hi,
In the MATLAB example, a seemingly random number was used apply the symbol+line template (or is this to apply a theme??): % Add data plot to graph layer invoke(dps, 'Add', dr, 202); % 202 for symbol+line plot
Is there anyway to determine the number that is associated with a user-defined template?
Thanks, John
Origin 2016 Operating System: Win10 |
|
sudd0030
11 Posts |
Posted - 01/27/2016 : 12:11:04 PM
|
So far what I've found is that these numbers correspond to these line type:
% 200 -- line % 201 -- symbol % 202 -- symbol+line
I found some documentation that makes it appear that the template is applied with the CreatePage command: CreatePage(PAGE_TYPE_WKS, "Data", "w", PAGE_VISIBLE); //"w" is template name while "Data" as worksheet page name
How does this syntax translate to MATLAB, and how do I use a user-defined template?
Something like this perhaps?
graph = invoke(originObj, 'CreatePage', 3, 'GraphName', 'Template Path')
Will I have to write the full path of the template? Or will I have to copy my user-defined template into the folder with the origin default .OTP files?
Thanks for any advice, John
|
|
|
sudd0030
11 Posts |
Posted - 01/27/2016 : 1:39:40 PM
|
So using the full template path does seem to work. This is the code I used:
myTemplatePath = C:\Users\myUsername\Documents\OriginLab\2016\User Files\myTemplate.otp graph = invoke(originObj, 'CreatePage', 3, 'myGraphName', myTemplatePath)
'myGraphName' will show up as the label to the graph window. |
|
|
jasonzhao
China
262 Posts |
Posted - 03/01/2016 : 02:45:57 AM
|
Hello,
You can refer to this page for the plot index: http://www.originlab.com/doc/COM/PLOTTYPES If you modify the graph and save the template as NewTmp (as shown in graph),
you can use the 'NewTmp' in your code instead of 'Origin'
eg: in example file: Origin2016\Samples\COM Server and Client\MATLAB\MATLABCallOrigin.m line 64
% Create a graph strGraph = invoke(originObj, 'CreatePage', 3, '', 'Origin');
can be replaced by strGraph = invoke(originObj, 'CreatePage', 3, '', 'NewTmp');
Best regards! Jason OriginLab Technical Service |
Edited by - jasonzhao on 03/01/2016 02:48:03 AM |
|
|
VladGets1
Germany
12 Posts |
Posted - 11/01/2016 : 07:51:44 AM
|
I do not have this label. Help me please.
quote: Originally posted by sudd0030
So using the full template path does seem to work. This is the code I used:
myTemplatePath = C:\Users\myUsername\Documents\OriginLab\2016\User Files\myTemplate.otp graph = invoke(originObj, 'CreatePage', 3, 'myGraphName', myTemplatePath)
'myGraphName' will show up as the label to the graph window.
|
|
|
|
Topic |
|
|
|