Graph Legend question
gregorK
when using the
Legend
command for a graph, is it possible to skip a selected trace on the graph from appearing in the legend?I have always a certain wave on a graph which I would like not to appear in the legend ...
I hope the question makes sense ...
Thanks!
Gregor
String graphName // "" for top graph
if (strlen(graphName) == 0)
graphName = WinName(0, 1) // Top graph
endif
String list = TraceNameList(graphName, ";", 1)
String legendText = ""
Variable numItems = ItemsInList(list)
Variable i
for(i=0; i<numItems; i+=1)
String item = StringFromList(i, list)
if (CmpStr(item,"wave1") == 0)
continue // Skip this trace
endif
String itemText
sprintf itemText, "\\s(%s) %s", item, item
if (i > 0)
legendText += "\r" // Add CR
endif
legendText += itemText
endfor
Legend/C/N=MyLegend/W=$graphName legendText
End
September 21, 2017 at 03:05 pm - Permalink
--
Gregor K
ALOISA Beamline
Elettra Synchrotron
September 22, 2017 at 02:49 am - Permalink