Dear All,

I am making a twoway graph as follows:

Code:
twoway (scatter daysMED week if  dateWeek<2841 & dateWeek>2715, color(gs10)) ///
(lowess daysMED week if  dateWeek<2841 & dateWeek>2715, bwidth(2) lcolor(black)) ///
(scatter daysMED week if dateWeek>2841 & dateWeek<2848, color(gs10)  ) ///
(lowess daysMED week if dateWeek>2841 & dateWeek<2848 , bwidth(2) lcolor(black)) ///
(scatter daysMED week if dateWeek>2847 & dateWeek<2970, color(gs10)) ///
(lowess daysMED week if dateWeek>2847 & dateWeek<2970, bwidth(2) lcolor(black)), xlabel(2767(20)2922, angle(45)) xline(2841) xline(2848) ///
xtitle("")  legend(col(2) row(3)) legend(size(vsmall))
It looks as follows:


Array
I would like to change the legend to:
2013w12-2014w33 Period before tramadol scheduling
2014w34-2014w41 Period after tramadol scheduling and before hydrocodone upscheduling
2014w42-2016w16 Period after hydrocodone upscheduling.

How can I do that?

Similarly, in another graph:
Code:
twoway (lfitci daysMED week if dateWeek>2833 & dateWeek<2842 ) ///
(lfitci daysMED week if dateWeek>2840 & dateWeek<2849 ) ///
(lfitci daysMED week if dateWeek>2847 & dateWeek<2855 ), xlabel(2834 "2014w27" 2836 "2014w29" 2838 "2014w31" 2840 "2014w33" ///
2842 "2014w35" 2844 "2014w37" 2846 "2014w39" 2848 "2014w41" 2850 "2014w43" 2852 "2014w45" 2854 "2014w47", ///
angle(45)) xline(2841) xline(2848) ///
xtitle("")  legend(col(2) row(3)) legend(size(vsmall))
which looks as follows:

Array

I would again like to have the legend as :

2014w27-2014w33 Period before tramadol scheduling
2014w34-2014w41 Period after tramadol scheduling and before hydrocodone upscheduling
2014w42-2014w47 Period after hydrocodone upscheduling.

Same question, how can I customize this legend as well?

I will be grateful for your help.
Sincerely,
Sumedha.