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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Unable to create graph

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
alexapostu Posted - 06/30/2020 : 4:32:00 PM
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;
};


3   L A T E S T    R E P L I E S    (Newest First)
alexapostu Posted - 07/02/2020 : 3:52:42 PM
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.



alexapostu Posted - 07/02/2020 : 11:28:03 AM
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?
YimingChen Posted - 07/01/2020 : 09:03:14 AM
Hi,

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

James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000