The Origin Forum
File Exchange
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
 All Forums
 Origin Forum for Programming
 Forum for Automation Server/COM and LabVIEW
 Loading the template to plot through Matlab
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

xlg786

China
1 Posts

Posted - 04/06/2019 :  04:17:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello:
I import the data from matlab into originlab 2018 to draw. I created a template about drawing styles for "Stacked lines by Y Offsets" styles. Then load the template in MATLAB to plot, but in the resulting figures, all the curves overlap, like the normal multi-Y-axis pattern, and don't draw like "Stacked lines by Y Offsets" templates, and don't know what's wrong. The code is as follows.
% Set data to the columns
invoke(wks, 'SetData', x, 0, 0);
Temp ='D:\ OffsetStackY.otpu';
strGraph = invoke (originObj, 'CreatePage', 3,' Data',Temp);
% Find the graph layer.
gl = invoke (originObj, 'FindGraphLayer', strGraph);

% Get dataplot collection from the graph layer.
dps = invoke (gl, 'DataPlots');

% Create a data range.
dr = invoke (originObj, 'NewDataRange');

% Add data to data range.
Invoke (dr, 'Add',' X ', wks, 0,0,-1,0);
Invoke (dr, 'Add',' Y ', wks, 0,1,-1,1);
Invoke (dr, 'Add',' Y ', wks, 0,2,-1, 2);

% Add data plot to graph layer.
Invoke (dps, 'Add', dr,200);

Edited by - xlg786 on 04/06/2019 07:52:48 AM
  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 © 2008 Originlab Corporation Go To Top Of Page
Snitz Forums 2000