Hi all, moderately new Stata user here using Version 15.1.

I have two groups (male and female) to be different colors on a two way rcap scatter plot (code attached below), but I cannot seem to get that to work. Males are coded as 1 and females as 0, and I need them on the same panel (not two separate panels), so I can't do by(male1female0). Every time I try and change the color in the code by using mcolor(blue) for example, it changes all of them. I have the data in rows, with each row representing 1 age and sex category (so 12 lines in total, since there are 6 age groups and 2 sexes). I created an "agecatjitter" variable, so for males it's slightly right of the marker, and for females it's slightly left of the marker.

Here's my code:

label define agecat 1 "12-14" 2 "14-16" 3 "16-18" 4 "18-20" 5 "20-22" 6 "Over 22"
label values agecat agecat
label define male1fe0 0 "Female" 1 "Male"
label values male1fe0 male1fe0
gen agecatjitter = agecat + 0.20 if male1fe0 == 1
replace agecatjitter = agecat - 0.20 if male1fe0 == 0

twoway rcap upper lower agecatjitter, lstyle(ci) || scatter prop agecatjitter, xlabel(,valuelabel) xlabel(1(1)6) xtitle(Age Category) ylabel(0(10)100) legend(off) ytitle(Percentage) title(Statistic by sex)

This produces a scatter plot with 12 markers with confidence intervals, but they're all the same color. I'm wanting the males whose age categories end in .20 to be one color (say blue), and the females whose age categories end in .80 to be another (say gray) while keeping them on the same graph. Any advice is appreciated. Thank you!

Best,
Andrea