TraceNameList
TraceNameList (graphNameStr, separatorStr, optionsFlag)
The TraceNameList function returns a string containing a list of traces in the graph window or subwindow identified by graphNameStr.
Parameters
graphNameStr can be "" to refer to the top graph.
When identifying a subwindow with graphNameStr, see Subwindow Syntax for details on forming the window hierarchy.
The parameter separatorStr should contain a single ASCII character such as "," or ";" to separate the names.
Details
The bits of optionsFlag have the following meanings:
| Bit 0: | Include normal graph traces | |
| Bit 1: | Include contour traces | |
| Bit 2: | Omit hidden traces (the default is to list even hidden traces) | |
| Bit 3: | Include box plot traces | |
| Bit 4: | Include violin plot traces | |
See Setting Bit Parameters for details about bit settings.
A trace name is defined as the name of the Y wave that defines the trace with an optional #ddd suffix that distinguishes between two or more traces that have the same wave name. It may also be a user-defined trace name. Since the trace name must be parsed, it is quoted if necessary..
Commands that take a trace name as a parameter or in a keyword can use a string containing a trace name with the $ operator to specify traceName. For instance, to change the display mode of a wave, you might use
ModifyGraph mode(myWave#1)=3
but
String myTraceName="myWave#1"
ModifyGraph mode($myTraceName)=3
will also work.
Examples
Make/O jack,'jack # 2';Display jack,jack,'jack # 2','jack # 2'
Print TraceNameList("",";",1)
// Prints: jack;jack#1;'jack # 2';'jack # 2'#1;
// Generate a list of hidden traces
Make/O jack,jill,joy;Display jack,jill,joy
ModifyGraph hideTrace(joy)=1 // hide joy
// (hidden + visible) - visible = hidden
String visibleTraces=TraceNameList("",";",1+4) // only visible normal traces
String allNormalTraces=TraceNameList("",";",1) // hidden + visible normal traces
String hiddenTraces= RemoveFromList(visibleTraces,allNormalTraces)
Print hiddenTraces
// Prints: joy;
See Also
Trace Names, Programming With Trace Names, User-defined Trace Names
For other commands related to waves and traces: WaveRefIndexed, XWaveRefFromTrace, TraceNameToWaveRef, CsrWaveRef, CsrXWaveRef, StringFromList.
For a description of wave references: Wave Reference Functions.
For a description of Traces: ModifyGraph.
For a discussion of Contour Traces: Contour Traces.
For commands referencing other waves in a graph: ImageNameList, ImageNameToWaveRef, ContourNameList, ContourNameToWaveRef.