Hello all,
I've run the syntax below to generate a figure where the three lines the right of the red vertical line should be dashed (as specified by -lpattern(dash)- when year>2020). However, they are still appearing as solid lines. It seems I'm overlooking something here, but am clueless what it might be. Would appreciate any insight you could share.
Figure:
I've run the syntax below to generate a figure where the three lines the right of the red vertical line should be dashed (as specified by -lpattern(dash)- when year>2020). However, they are still appearing as solid lines. It seems I'm overlooking something here, but am clueless what it might be. Would appreciate any insight you could share.
Code:
twoway (scatter yesC_group1_score2 year if year>2020, msymbol(t) mcolor(orange_red)) /// (scatter yesC_group2_score2 year if year>2020, msymbol(t) mcolor(black)) /// (scatter yesC_group3_score2 year if year>2020, msymbol(t) mcolor(green)) /// (line noC_group1`_score2 year if year>2020, lcolor(orange_red) lpattern(dash)) /// (line noC_group2_score2 year if year>2020, lcolor(black) lpattern(dash)) /// (line noC_group3_score2 year if year>2020, lcolor(green) lpattern(dash)) /// (line noC_group1_score year if 2016<year<=2020, lcolor(orange_red) lpattern(solid)) /// (line noC_group2_score year if 2016<year<=2020, lcolor(black) lpattern(solid)) /// (line noC_group3_score year if 2016<year<=2020, lcolor(green) lpattern(solid)), /// title("Test ") xtitle(" Year") xline(2020.5, lcolor(red)) graphregion(color(white)) xlabel(2017(1)2023) ysize(2) xsize(2.5) ylabel(305(5)330, gmin gmax angle(0)) ytitle("Score ") legend(cols(2) order(1 4 2 5 3 6 7 8) label (1 "Group1") label (1 "Group1 - condition 1") label (2 "Group2 - condition 1") label (3 "Group3 - condition 1") label (4 "Group1 - condition 0") label (5 "Group2 - condition 0") label (6 "Group3 - condition 0")) leg(off)
Figure:
Comment