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
 Using the command window for repetitive plotting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bittehttps

1 Posts

Posted - 03/27/2017 :  07:38:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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...

Edited by - bittehttps on 03/27/2017 07:47:52 AM

yuki_wu

896 Posts

Posted - 03/28/2017 :  01:34:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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