I am trying to learn Igor programming (too hard :-( ) and I just started to create functions. I would like to know how we can Append the loaded waves to the top wave (which I created earlier) ? I made this simple function but it does not work unless I put in the header of the file I want to load the word "Decay"
#pragma rtGlobals=1// Use modern global access method.Function LoadGraph()Make/O/N=4090/D 'Decay'
Display/M/W= (22,1.5,33.5,9.5); AppendToGraph 'Decay'
DoWindow/F Graph0
LoadWave/O/G/W/A
SetScale/Ix0,200,"ns", Decay
End
PS: Is there a recommended method to learn Igor programming -_-' ?Decay.txt(16.5 KB)
First, create the graph manually with nothing in it by executing:
Display
from the command line.
Now here is a function that will load a file and append to the top graph:
Function LoadGraph()DoWindow/F Graph0
LoadWave/O/G/A
if(V_flag == 0)// V_flag is set by LoadWavereturn -1// User cancelled - -1 signifies cancelendifString name = StringFromList(0, S_waveNames)// S_waveNames is set by LoadWaveWave w = $name// Get a wave reference for the loaded waveSetScale/Ix0,200,"ns", w // Set wave's X scalingAppendToGraph w // Append to top graphreturn0// Zero-signifies success End
To learn more execute this:
DisplayHelpTopic"Loading Waves Using Igor Procedures"
Quote:
Is there a recommended method to learn Igor programming
First, if you have not already done it, do the Igor guided tour by choosing Help->Getting Started. This is a prerequisite.
Next read these chapters in the PDF manual:
IV-1: Working With Commands
IV-2: Programming Overview
IV-3: User-Defined Functions
IV-5: User-Defined Menus
IV-6: Interacting With The User
Thank you very much hordstein, but the SetScale does not work! and I do not understand all ° _ ° ' This is really hard.
No I have not yet read the Igor's manul....
Thank you very much hordstein, but the SetScale does not work! and I do not understand all ° _ ° ' This is really hard.
No I have not yet read the Igor's manul....
Unless you at least go through the Guided Tour and understand Igor's "wave scaling", you will be wasting a lot of time just trying stuff that doesn't work.
Choose "Getting Started" from Igor's Help menu, start with "Introduction to Igor Pro", continue through "Waves - The Key Igor Concept". You *could* try skipping to the "User-Defined Functions" help topic, but Howard's suggested reading list is more likely to lead to success.
Display
from the command line.
Now here is a function that will load a file and append to the top graph:
To learn more execute this:
First, if you have not already done it, do the Igor guided tour by choosing Help->Getting Started. This is a prerequisite.
Next read these chapters in the PDF manual:
IV-1: Working With Commands
IV-2: Programming Overview
IV-3: User-Defined Functions
IV-5: User-Defined Menus
IV-6: Interacting With The User
March 17, 2013 at 04:56 pm - Permalink
No I have not yet read the Igor's manul....
March 19, 2013 at 08:13 am - Permalink
Unless you at least go through the Guided Tour and understand Igor's "wave scaling", you will be wasting a lot of time just trying stuff that doesn't work.
Choose "Getting Started" from Igor's Help menu, start with "Introduction to Igor Pro", continue through "Waves - The Key Igor Concept". You *could* try skipping to the "User-Defined Functions" help topic, but Howard's suggested reading list is more likely to lead to success.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
March 19, 2013 at 10:37 am - Permalink
March 20, 2013 at 01:23 am - Permalink