How to get the color, size etc. of all the traces in a graph

I have a graph and want to get the color, size etc. of the traces but am unable to do so. I tried "TraceInfo", but it is giving the same value of zColor etc. for the traces with different color on the graph. If anyone has any suggestions, then please let me know.
Thanks
Abhinav
Quote:
I tried "TraceInfo", but it is giving the same value of zColor etc. for the traces with different color on the graph.


zColor is not the color of the trace. The keyword for the trace color is rgb. Try this:

Make jack=sin(x/8), joe=cos(x/8)
Display jack, joe
ModifyGraph rgb(joe)=(0, 0, 65535)
Print TraceInfo("Graph0", "jack", 0)
Print TraceInfo("Graph0", "joe", 0)


This prints (among other output):
rgb(x)=(65535,0,0) // For jack
rgb(x)=(0,0,65535) // For joe


Here are some functions that illustrate how to get the trace color:
Function GetColorOfTrace(graphNameStr, traceNameStr, instance, red, green, blue)
    String graphNameStr
    String traceNameStr
    Variable instance
    Variable &red, &green, &blue    // Outputs
   
    String info=TraceInfo(graphNameStr, traceNameStr, instance)
   
    String rgbStr
    rgbStr = StringByKey("rgb(x)", info, "=")       // e.g., "rgb(x)=(0,0,65535)
    // Print rgbStr     // For debugging only
   
    sscanf rgbStr, "(%d,%d,%d)", red, green, blue
End

Function DemoColorOfTrace(graphNameStr, traceNameStr, instance)
    String graphNameStr
    String traceNameStr
    Variable instance

    Variable red, green, blue
    GetColorOfTrace(graphNameStr, traceNameStr, instance, red, green, blue)
    Print red, green, blue
End


You would invoke this from the command line like this:
DemoGetColorOfTrace("Graph0", "joe", 0)


Later . . .

I now remember that I posted a snippet on this a while ago. It's basically the same: http://www.igorexchange.com/node/875