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
 Origin Forum
 Import x, y; calculate log(y) and plot

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
ONeilll Posted - 03/15/2017 : 03:43:44 AM
Origin Ver. and Service Release: 8G SR4 v8.0951
Operating System: W7

Hello!

I have the following import filter which imports and plots and x, z graph:
%A = page.info.system.import.filename$; //Get the filename
%B = %[%A, '.'];
plotxy iy:=((1,2)) plot:=200 ogl:=[<new template:= XRR_Templat name:= %A>]; // Plot data, rename the graph window

What I want to achieve is that x,y are importet and then log(y) is automatically calculated and plottet against x. Any ideas how to do that?

Thank you very much!

Kind regards
ONeilll
2   L A T E S T    R E P L I E S    (Newest First)
ONeilll Posted - 03/15/2017 : 10:28:09 AM
Dear Yuki,

thank you very much, your code works fine for me.

Kind regards
ONeilll
yuki_wu Posted - 03/15/2017 : 05:09:03 AM
Hi,

After file imported, you need to add a column, and put the value of log (y) in the new column, then plot the graph. To achieve it, you can add a few lines of script in your import filter:

nn = wks.nCols; //Get the number of columns
wks.nCols = nn + 1; // Add a column in worksheet
col($(nn+1)) = log(col(2)); // Calculate the log value of column B
plotxy iy:=(1,$(nn+1)); //Plot x vs log(y)

Hope it helps.

Regards,
Yuki
OriginLab

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