Colouring a 2D Wave with f(z) within a Range

Hello, I was wondering if I could get some help on colouring a 2D graph using the f(z) colour wave function.

I would like to colour my wave in multiple colours such that x-values {0,30} correspond to one colour, x-values {31,60} correspond to another colour, and x-values {61,90} correspond to a different colour, so on so forth. I have been playing around with the f(z) function using a colour wave index to try and colour a wave but to no avail. I have only been able to get the colours to correspond to the y-axis, but not specific ranges along the x-axis. I would like for this to apply to a wave that I already have.

Thank you!

Here's what I did. First, a graph with a 91-point wave:

make/n=91 junk=sin(x/7);display junk

Then make and fill a three-column wave to provide the colors:

make/n=(90,3) colors
//first 31 rows set to red:
•colors[0,30][0] = 65535
•colors[0,30][1,2] = 0
//31 to 60 set to green:
•colors[31,60][0] = 0
•colors[31,60][1] = 65536
•colors[31,60][2] = 0
// 60 to 90 set to blue:
•colors[61,90][0,1] = 0
•colors[61,90][2] = 65535

Finally, I double-clicked the trace to get the Modify Trace dialog. I clicked Set as f(z) to bring up the Set as f(z) dialog. I selected Three of Four Column Color Wave as the Color Mode. Then I selected colors as the Color Wave. Finally clicked OK, then Do It. This generated this command:

ModifyGraph zColor(junk)={colors,*,*,directRGB,0}

Using a three- or four-column wave allows you to choose arbitrary colors for your graph. You might use the Color Wave Editor to choose colors, but setting 91 colors that way would be pretty tiring. You could set the first row of each section of colors to a desired color, then use wave assignments to copy those colors to other rows:

colors[1,30][] = colors[0][q]
colors[32,60][] = colors[31][q]
colors[62,90][] = colors[61][q]

Bring up the Color Wave Editor by selecting Data->Packages->Color Wave Editor