Automatically add tags to all points on graph from text wave
Posted September 29th, 2009 by cwenger
This function automatically adds tags to a graph from a text wave. You must specify the graph name ("" for top graph) as a string, the trace name to be labeled as a string, and the text wave that the labels should come from. The labelWave should have at least as many points as the wave to be labeled.
Function AddTagsFromWave(graphName, traceName, labelWave) String graphName String traceName Wave/T labelWave Wave w = TraceNameToWaveRef(graphName, traceName) Variable index for(index = 0; index < numpnts(w); index+=1) String tagName = "label" + num2str(index) Tag/C/N=$tagName/F=0/TL=0 $traceName, index, labelWave[index] endfor End
