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
 Origin Forum
 Draw vertical lines to identify spectrum peaks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rdelvill

Belgium
9 Posts

Posted - 03/14/2012 :  12:01:05 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a X-ray emission spectrum (counts in function of wavelength) and I would like to identify the peaks I obtain. To do this I would like to plot a set of vertical lines at the position where the tabuled X-ray emission lines of my elements are supposed to be. Basically, I want to plot on top of my graph something like:

x= 2.3;
x= 2.8;
X= 3.1;
... etc

I found a post at the following address
http://www.originlab.com/www/support/resultstech.aspx?ID=165&language=English&Version=All
but the script is not working when I just type it in the script window and press enter

Could somebody help?

Thank you

Hideo Fujii

USA
1582 Posts

Posted - 03/14/2012 :  2:08:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rdelvill,

I have tried the command like:
  draw -n vline -l -v 5
in Script window followed by pressing ENTER in my Origin 8.6, and it worked. 

Probably you put a semicolon(;) at the end of line in Script window, then press ENTER. 
Semicolon is OK to be placed to separate multiple commands in a single line, 
or when commands are in a script file (*.ogs); but if you enter a single command, 
you cannot put a semicolon at the end of the line. 

Hope this is the case.

--Hideo Fujii
OriginLab
Go to Top of Page

rdelvill

Belgium
9 Posts

Posted - 03/15/2012 :  04:07:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It works indeed by omitting the coma.
Now I can display one vertical line but what would be the best way to display together a set of lines and not just one? In addition I would like a add a tag (small text) to each line in order to identify them.

Thanks

Edited by - rdelvill on 03/15/2012 07:17:02 AM
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 03/15/2012 :  6:57:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rdelvill,

If you need a bunch of vertical lines, you can define and use a macro such as:

define vv {draw -l -v %1};
vv 15;
vv 16;
vv 17;

You can highlight lines you want to run, and press ENTER key. (By this way, you put semicolon at each command line.)

For the text label, if you want beyond to put your own text label manually, for example, you can put a script for the line object such as below. This script makes a label on top of the line for the X position when the line is clicked by mouse. (Open this dialog by
ALT+double-click, or right-click and choose Programming Control flyout.)



--Hideo Fujii
OriginLab
Go to Top of Page

DVC

Australia
1 Posts

Posted - 03/26/2015 :  9:59:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is almost exactly what I need. However I need to be able to put the vertical lines behind the spectrum.

If I put the line assignments in front of the spectrum it obscures the emission lines themselves.

How do I put the vertical lines behind the spectrum? (Ver 6.1)
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 03/27/2015 :  5:34:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Recent versions have a tool from "Graph: Add Straight Line" menu to do such job, so you don't have to reply on the script command.
Regarding the control of putting the line object in front or behind of the plot, you can press "Front(data)" or "Back(data)" button in the Object Edit toolbar, accordingly.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 03/27/2015 5:35:52 PM
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