Plots and ModifyGraph command

Hi all,

I'm trying to generate a plot from two separate 2D waves with respect to their x-scaling in a for-loop. It currently looks something like this:


Display
for (bb = 0; bb < num_cols; bb += 1)
	AppendToGraph :wave1[][bb]
	AppendToGraph :wave2[][bb]
	ModifyGraph mode(wave2)=2,lsize(wave2)=3,rgb(wave2)=(1,16019,65535)
endfor


The above is currently not doing what I'd like to see - which is, wave1 plotted in the default trace appearances, and wave2 modified as per the
ModifyGraph
line, for ALL values of bb. What I'm seeing now is it's only happening for the final value of bb.

When doing this manually, I learnt that one can add the # to modify each trace name (?) from the following in the IGOR manual: "More precisely, traceName is a wave name, optionally followed by the # character and an instance number. For example, "mode(myWave#1)=4"." Not really getting it - adding "#bb" does not work.

Any help is appreciated. Thank you
paperlovestory wrote: Hi all,

I'm trying to generate a plot from two separate 2D waves with respect to their x-scaling in a for-loop. It currently looks something like this:


Display
for (bb = 0; bb < num_cols; bb += 1)
	AppendToGraph :wave1[][bb]
	AppendToGraph :wave2[][bb]
	ModifyGraph mode(wave2)=2,lsize(wave2)=3,rgb(wave2)=(1,16019,65535)
endfor


The above is currently not doing what I'd like to see - which is, wave1 plotted in the default trace appearances, and wave2 modified as per the
ModifyGraph
line, for ALL values of bb. What I'm seeing now is it's only happening for the final value of bb.

When doing this manually, I learnt that one can add the # to modify each trace name (?) from the following in the IGOR manual: "More precisely, traceName is a wave name, optionally followed by the # character and an instance number. For example, "mode(myWave#1)=4"." Not really getting it - adding "#bb" does not work.

Any help is appreciated. Thank you


I just tried a do-while loop as well:


bb = 0
do
Display
	AppendToGraph :wave1[][bb]
	AppendToGraph :wave2[][bb]
	ModifyGraph mode(wave2)=2,lsize(wave2)=3,rgb(wave2)=(1,16019,65535)
bb += 1
while (bb < num_cols)


But this resulted in an infinite loop...?

	wave wave1=wave1
	variable bb = 0, num_cols=dimsize(wave1,1)
	string s_trace
	Display // make a graph window before looping
	do
		s_trace="MyTraceName"+num2str(bb)
		AppendToGraph wave1[][bb] /TN=$s_trace
		ModifyGraph mode($s_trace)=2,lsize($s_trace)=3,rgb($s_trace)=(1,16019,65535)
		bb += 1
	while (bb < num_cols)