1. There are no predefined color schemes. You can set default colors yourself via Options->Graphics defaults but it is up to you to choose the colors. Since you will have a variable number of groups, you will have manually determine and set the color for each group yourself. To determine the color in RGB units, you can:
1.Open the Options->Graphics default dialog and select Graph Elements->Lines and Symbols.
2.Click the Color box which should bring up the color dialog.
3.Choose a base color (red for example)
4.Write down the Red, Green and blue values
5.Use the slider on the right to adjust the shade
6.repeat step 4 and 5 for the max number of groups
This will give you a set of colors. From here, you can then set within the code the colors for each group. For example, for 3 groups use color #1, #5 and #10, for 10 groups use #1 through #10, etc. Understandably, this is long and tedious but it will get the desired effect.
2.Just so that we are on the same page. Here is a program that takes 3 series (workfile has 900 observations) and creates a matrix containing the 3 series but broken into 3 subseries. It also places the trend (ie the x-axis) series in between each subseries so that we can use 'xypair'.
Code: Select all
create u 900
series t=@trend+1
series ser1 = rnd
series ser2 = 2*rnd
series ser3 = 3*rnd
group g t ser1 t ser2 t ser3
smpl 1 300
matrix first = @convert(g)
smpl 301 600
matrix second = @convert(g)
smpl 601 900
matrix third = @convert(g)
matrix full = @hcat(first, second)
full = @hcat(full, third)
freeze(mygraph) full.xypair
mygraph.setelem(1) linecolor(black)
show mygraph
To answer your question, setelem refers to each pair. It does not refer to each column in the series (for xypairs) like it would in the normal line graph case. Setelem(1) refers to pair 'c1-c2', setelem(2) refers to 'c3-c4'.
3.Unfortunately you cannot.
Going back to question #1 and using my example, you could then add:
Code: Select all
mygraph.setelem(1) linecolor(rgb(255,0,0)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(2) linecolor(rgb(155,100,100)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(3) linecolor(rgb(0,0,0)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(4) linecolor(rgb(255,0,0)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(5) linecolor(rgb(155,100,100)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(6) linecolor(rgb(0,0,0)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(7) linecolor(rgb(255,0,0)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(8) linecolor(rgb(155,100,100)) symbol(CIRCLE) linepattern(none)
mygraph.setelem(9) linecolor(rgb(0,0,0)) symbol(CIRCLE) linepattern(none)