Write a variable to graph text box
Kino
I have written a procedure file (auxiliary, which I save and load in) which includes a function for data processing and some graph macros generated by Igor (window recreation)....
This file lets me do quick, real time processing of large data sets. (Being able to turn this data around quickly is critical). My function automatically imports my data files, runs the calcs, generates the graphs and outputs a text file. I then kill all the waves and repeat when the next test is complete. In my function, I ask the user to enter the run number of the test and use that write an output text file.
The only thing that is left is to be able to automatically put the run number on the graph.
I have the run number as a local variable to my function. How do I pass that number to my graph macros and put it in a text box? Even making the run number a global, I have not figured out how successfully pass it to the macro, let alone create text box with it. Is this possible to do?
Thanks in advance.
Variable runNumber=1234
String graphName="Graph0"
Display/N=$graphName myWave
TextBox/W=$graphName/C/N=RunText "Run "+num2istr(runNumber)
End
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
October 6, 2010 at 02:45 pm - Permalink
The last bit of the TextBox command is just what I needed. In the end, I made my RunNumber a global variable and then used
TextBox/C/N=text1/A=MC/X=-44.0/Y=47.0 "Run "+num2istr(g_runnum)
in all my 5 of my graph macros. This way the text box is not dependent on my calculations procedure, so I can regenerate the graphs and still have the number attached.
Now I don't have to worry about forgetting to label graphs anymore! Easy fix.
Thanks again!
October 7, 2010 at 06:52 am - Permalink