Automatically add tags to all points on graph from text wave

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

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More