Legends with more wave info
DRDana
Sat, 04/02/2011 - 04:52 pm
I would like an option for the default legend in a graph to include the data folder, in addition to the name, of each wave in the graph. Ideally this would include control over whether to include the complete path, or only the name of the containing folder (though if I had to choose one, I would definitely prefer to have just the containing folder). The documentation frequently refers to organizing projects as multiple runs in folders, where the waves have identical names, and indeed I find this a very useful approach. But it requires hand-tweaking the graph legends to distinguish the waves from each other (or writing special functions, as shown in the Data Folder Tutorial experiment).
Similarly, I would greatly appreciate if the legend included x waves when XY pairs are plotted.
April 2, 2011 at 06:11 pm - Permalink
Ideal would be 3 options: the wave name only, the data folder only (maybe with two versions like getdatafolder(1) and getdatafolder(0)), and both, wavename and folder.
Currently I'm using this code for it:
variable i
variable noftraces = itemsinlist(TraceNameList("",";",1))
string legendstr = ""
for(i=0;i<noftraces;i+=1)
legendstr = legendstr + "\\s("+stringfromlist(i,TraceNameList("",";",1))+") " + GetWavesDataFolder(WaveRefIndexed("",i,1) , 1 ) +"\r"
endfor
legend/C/N=text0/J legendstr
end
May 23, 2011 at 06:33 am - Permalink