Accessing Traces in Scatterplot

Hi,

I have an interface with a scatterplot and intending to have the option to set the point color to a color wave via checkbox.

The interface has some traces I do not want to change and as such I wanted to cycle through the trace name list, however when I do the tracenamelist command I do not get the traces in the scatterplot.

I have used the embedded graph function for scatterplot so what is the syntax I need to programmatically set the coloring.

Andy

Hi,

Figured it out but I thought I would leave a solution if some has a need in the future.

I use child window list to get the full list of windows. Now for my purposes I remove window "P0" since that is a panel that holds the controls and not any graphs.  I then append the name of the subwindow to the base name and adjust the traces in that window.  In this case either colored by Z or just base color.

function colorBYcluster2(variable Choice)

    string thetrace,tracelist
    wave Cluster_colors,GCLM_Cluster
    tracelist =childWindowList("scattercluster")
    tracelist =removeFromList("P0",tracelist)
    variable index,maxindex
    maxindex=itemsInList(tracelist)
    for(index=0;index<maxindex;index+=1)
        thetrace ="scattercluster#"+StringFromList(index, tracelist)
            if(choice)
                ModifyGraph/w=$thetrace zColor={GCLM_cluster[*][%cluster],*,*,cindexRGB,0,Cluster_Colors}
            else
                ModifyGraph/w=$thetrace zColor=0
            endif
    endfor

end

Andy