Proper titles for wave columns

Hi,

My code does the job I want it to do, but it would help with the visualization of the data that it produces if I could modifiy the title of the wave columns. My complete code creates several waves in the root folder and then files these with data. The number of columns in each of these root waves is determined by the number of data folders (present in the root folder) which I want the code to work on.

I have a vastly simplified version of my code below. How would I modify the NiceColumnNames function so that instead of getting three columns all named 'PeakAmplitudes', I get three columns named: 'CG1', 'CG2' and 'CG3'?

Thanks,

Function MakeDFs()
    
    NewDataFolder/O root:CG1
    NewDataFolder/O root:CG2
    NewDataFolder/O root:CG3
    
    NewDataFolder/O root:Junk
 
End
 
Function NiceColumnNames (vTPWaveNrB4exp)
 
    Variable vTPWaveNrB4exp
 
    Variable vTotalNrOfDFs  = CountObjectsDFR(root:, 4) 
    Variable vIndex
    Variable vCounter
    
    Variable vNrOfDFs
        
    for (vIndex = 0; vIndex < vTotalNrOfDFs; vIndex += 1)
        
        String sDFinRoot = GetIndexedObjNameDFR(root:, 4, vIndex)
        Variable vMatch = StringMatch(sDFinRoot,"CG*")
        
        if (vMatch == 1)
            vNrOfDFs = vNrOfDFs + 1 
        endif
    
        Make/O/N=(vTPWaveNrB4exp*2+5, vNrOfDFs) PeakAmplitudes = NaN
        
    endfor
 
 
End
I think you want to use dimension labels. Here is an example:

Make/N=(5,3) test
Edit test
AppendToTable test.ld           // Append dimension labels to table
SetDimLabel 1, 0, First, test
SetDimLabel 1, 1, Second, test
SetDimLabel 1, 2, Third, test


For details execute:
DisplayHelpTopic "Dimension Labels"


Unfortunately, there is no way to show the horizontal dimension labels while hiding the horizontal dimension labels.

Another approach is to use table column titles. For example:
Make/O/N=(5,3) test
Edit test
ModifyTable title[1] = "First"
ModifyTable title[2] = "Second"
ModifyTable title[3] = "Third"


For details execute:
DisplayHelpTopic "Column Titles