appending same data to right axis
linepic
but error occures with wave name which I cannot solve.
My wave names are -0.5 V etc, so it should be typed as '-0,5 V'.
it works with commend windows but not with procedures.
It would be grateful if experts give some valuable comment on that.
Function plotfordisplay()
//add logscale on right axis
wave VG
String traces=TraceNameList("",";",3)
variable i
for (i=0; i<itemsinlist(traces); i+=1)
String trace = Stringfromlist(i, traces)
wave appendaa = $trace
appendtograph/R appendaa vs VG
endfor
end
//add logscale on right axis
wave VG
String traces=TraceNameList("",";",3)
variable i
for (i=0; i<itemsinlist(traces); i+=1)
String trace = Stringfromlist(i, traces)
wave appendaa = $trace
appendtograph/R appendaa vs VG
endfor
end
TraceNameToWaveRef
to reference your waves.Here is an example, where I have modified your function, and made some example data so as to have a self contained snippet that illustrates the point (this is always a good idea!).
//add logscale on right axis
wave VG
String traces=TraceNameList("",";",3)
variable i
for (i=0; i<itemsinlist(traces); i+=1)
String trace = Stringfromlist(i, traces)
wave appendaa = TraceNameToWaveRef("", trace)
appendtograph/R appendaa vs VG
endfor
ModifyGraph log(right)=1
end
Function doStuff()
// make some fake data
Make/O/D/N=20 VG = x
Make/O/D/N=20 '-0,5 V' = gnoise(0.1) + exp(x/10)
Make/O/D/N=20 '-1,0 V' = gnoise(0.1) + (x/10)^2
Make/O/D/N=20 '-1,5 V' = gnoise(0.1) + 1.5
// Make initial graph
Display '-0,5 V' vs VG
AppendToGraph '-1,0 V' vs VG
AppendToGraph '-1,5 V' vs VG
// call the function
plotfordisplay()
End
Hope this helps,
Kurt
March 28, 2017 at 11:32 pm - Permalink
displayhelptopic "PossiblyQuoteName"
HJ
March 29, 2017 at 02:01 am - Permalink
I appreciate your help!
March 29, 2017 at 11:57 am - Permalink