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
 Unable to create graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

alexapostu

Romania
10 Posts

Posted - 06/30/2020 :  4:32:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
I want to create a script, that creates me a new graph for all the columns I have in my sheet. I have around 10 columns and the first column should be the X and then Y should be the next 9 columns (1-2-3-5...9) .
My code is unable to do this, and also I am unable to specifi the numebr of columns nor to see if my FOR gets the correct dataset.

string rSheet$ = page.name$;
string rPage$ = layer.name$;

range rSheet = $(page.active)!;
range rPage = rSheet.GetPage()$;
for( ii = 1 ; ii < int(rSheet.NCOLS) ; ii += 2 )
{
plotxy [%(rPage.name$)]%(rSheet.name$)!($(1),$(ii+1)) ogl:=$(ii);
page.active = ii;

};

// Set symbol size
// %C is the active dataset
sec -p 1;
set %C -z 20;
// Set symbol shape
sec -p 1;
set %C -k 3;
// Set symbol color
sec -p 1;
set %C -c color(blue);
// Connect the symbols
sec -p 1;
set %C -l 1;
// Change plot line color
sec -p 1;
set %C -cl color(red);
// Set line width to 4 points
sec -p 1;
set %C -w 2000;
// Change solid line to dash
sec -p 1;
set %C -d 1;


layer -s 2; // make layer 2 active
Rescale; // rescale layer 2

legendupdate dest:=0 update:=0 mode:=custom custom:=@ln;
// Modify the legend settings for each layers
doc -e LW {
// Set legend font size
legend.fsize=28;
// Set legend font color
legend.color=color(blue);
// Move legend to upper-left of the layer
legend.x=layer.x.from+legend.dx/2;
legend.y=layer.y.to-legend.dy/2;
};


YimingChen

1666 Posts

Posted - 07/01/2020 :  09:03:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Here the rSheet is used to define both string and range which causes conflict. Please change one to a different name.

James
Go to Top of Page

alexapostu

Romania
10 Posts

Posted - 07/02/2020 :  11:28:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I deleted that part but it still did nothing.
Let me show you what it does.
https://we.tl/t-3EACXBPFLp

It should create a new file with all 10 graphs one beneith eachother, or separate... do you have any idea?
Go to Top of Page

alexapostu

Romania
10 Posts

Posted - 07/02/2020 :  3:52:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The thing is, I do not find the code that I can use to specify that I need all my graphs to be shown one underneath the other.
Also,please check below my worksheet and what I am getting as graph.
It should be one underneath eachother.
Do you know how to extend the graph page more.



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