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
 Using the command window for repetitive plotting

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
bittehttps Posted - 03/27/2017 : 07:38:51 AM
Origin Ver.:2017, b9.4.0.220
Operating System:Win7 64Bit

I have quite a few measurements imported into an origin project.
General layout: ColA is X, B,C and D are Y. I have one workbook per measurement each containng just one sheet in the same folder

I want to get the first derivative of C and D, and plot X against B, against C and Y and against E and F (the derivatives). Ideally the graphs would all have the y-axis with a logarithmic scale and be named after the worksheet.

I tried the following:

range aa = [A10006]1000 6!col(A,C);
differentiate iy:= bb plot:=1;

Imagine this being copied into the script window for a few hundred times.
Well it did not work. While it does plot something, it always plots the very same curve (the one of the very first workbook). And it also only plots something when I manually navigate to the corresponding line and hit enter (like one graph per enter).
My first questions: Can variables be redefined?

My second question:
The long name of one of my workbooks is "7030 5.txt" (per import), the short name is "A70305". The worksheet in question is called "7030 5".

How do I properly call this in the script?

range ab = [A70305]7030 5!col(A,C);
differentiate iy:= ab plot:=1;

yields

Failed to resolve range string, VarName = iy, VarValue = (,ab)
#Command Error!

And I don't know why because

range aa = [A1001]0100 1!col(A,C);
differentiate iy:= aa plot:=1;

works just fine.

My third question is:
Does anyone, by any chance, have a handy script that might do what I need?

As far as I understood batch plotting it is still a lot of work. It does make plotting faster, but you still have to do it over and over again, by hand.

That reminds me, it would be phenomenal to be able to define a standard for all plots. Like the logarithmic scale, it is just really annoying having to change scale by hand for each plot...
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 03/28/2017 : 01:34:53 AM
Hi,

I supposed you are not familiar with LabTalk, so I strongly recommend that you take a look at these pages at first:

Question1: http://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs
http://originlab.com/doc/X-Function/ref/plotxy
http://www.originlab.com/doc/X-Function/ref/differentiate

Question2: http://www.originlab.com/doc/LabTalk/guide/Range-Notation#Page_and_SheetRange.2C_Page_and_Sheet

Question3: Just take a simple example:
There are 3 columns. After executing the command as follow, we can get two graphs, and each graph has a data curve and its derivative curve.

range wks = ["Book1"]"Sheet1"!;
int ncols = wks.nCols; 
   
loop(ii, 2, ncols)
{
	differentiate iy:= ["Book1"]"Sheet1"!col($(ii)) plot:=1; 
	plotxy iy:=["Book1"]"Sheet1"!(1,$(ii));
}

Hope it helps.

Regards,
Yuki
OriginLab

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