Place Cursor on Graph with Script
ItalliaVP
I am completely new to scripting and to Igor. I'm trying to analyze waves that I've generated from my data. These waves are very stereotyped in their X-axis rise and fall. I need to place cursors around the base of each peak so it can find the peak Y-value. I have a lot of waves to analyze, and was hoping I could automate the system by not having to manually drag the cursors for each generated wave. Is there a script code that will allow me to place Cursor A and Cursor B at designated X values? I tried typing "Cursor A (X value=0.2)" but it said the cursors first have to be placed on the graph, and I can't figure out how to do this with script.
Any suggestions appreciated!
Thanks,
Itallia V.P.
Note to use tracename which maybe different than wave name.
Cursor [flags] cursorName traceName x_value
cursorName is one of ten cursors A through J.
Flags
/A=a a =1: Activates the cursor.
a =0: Deactivates the cursor.
Active cursors move with arrow keys or the cursor panel.
/C=(r,g,b,[a] ) Sets the cursor color (default is black). r, g and b specify the amount of red, green and blue in the color of the waves as an integer from 0 to 65535.
In Igor Pro 7.00 or later, optionally provide a to set transparency, with 0 being fully transparent (invisible) and 65535 being fully opaque (default).
/F Allows cursor to roam free. The trace or image provides the axis pair that defines x and y coordinates for the setting and readout. Use /P to set in relative coordinates, where 0,0 is the top left corner of the rectangle defined by the axes and 1,1 is the right bottom corner.
/H=h Specifies crosshairs on cursors.
h =0 Full crosshairs off.
h =1 Full crosshairs on.
h =2 Vertical hairline.
h =3 Horizontal hairline.
/I Place cursor on specified image.
/K Removes the named cursor from the top graph.
/L=lStyle Line style for crosshairs (full or small).
lStyle =0: Solid lines.
lStyle =1: Alternating color dash.
See the manual for the rest of flags and more details.
Andy
December 1, 2017 at 06:53 pm - Permalink
Thanks for the suggestion. I'm still not clear on how it works. I tried a ton of variations but all of them say syntax error. I must be misunderstanding the language. Can you show me an example: what would it look like to activate the cursor A on Graph0 at x=0.2?
December 13, 2017 at 12:23 pm - Permalink
December 13, 2017 at 12:44 pm - Permalink
cursor A $stringfromlist(0, TraceNameList("",";",1)) 0.2
puts cursor on first trace of top graph
if you're plotting with an x-wave it may not appear in the position you expect.
December 13, 2017 at 12:48 pm - Permalink
•setscale x,0,1,"s" test
•test=x*sin(10*x)
•cursor A test 0.2
HJ
December 13, 2017 at 12:57 pm - Permalink
December 13, 2017 at 05:55 pm - Permalink