Hi, I'm having trouble in getting the exact series plots that I want. Particularly, I want add a refline at March 2020, but the plot only does not show Mar in 2020. Here is the dataset that I made up and what I did to make the plots data input1;
input monthlyyear :date9. amount type;
format monthlyyear date9.;
datalines;
01JAN2016 4 1
01FEB2016 6 3
01MAR2016 5 2
01APR2016 39 2
01MAY2016 49 1
01JUN2016 34 3
01JUL2016 49 2
01AUG2016 30 1
01SEP2016 30 2
01OCT2016 2 3
01NOV2016 34 3
01DEC2016 30 3
01JAN2017 56 2
01FEB2017 45 1
01MAR2017 45 1
01APR2017 34 2
01MAY2017 45 3
01JUN2017 45 2
01JUL2017 23 2
01AUG2017 26 1
01SEP2017 45 2
01OCT2017 35 1
01NOV2017 67 2
01DEC2017 20 3
01JAN2018 34 3
01FEB2018 56 2
01MAR2018 67 3
01APR2018 20 2
01MAY2018 29 3
01JUN2018 24 2
01JUL2018 49 2
01AUG2018 32 1
01SEP2018 27 1
01OCT2018 24 2
01NOV2018 28 3
01DEC2018 35 2
01JAN2019 45 3
01FEB2019 74 2
01MAR2019 73 1
01APR2019 83 1
01MAY2019 82 3
01JUN2019 85 2
01JUL2019 43 3
01AUG2019 82 2
01SEP2019 62 1
01OCT2019 74 3
01NOV2019 35 3
01DEC2019 65 3
01JAN2020 45 2
01FEB2020 4 2
01MAR2020 94 2
01APR2020 82 1
01MAY2020 84 2
01JUN2020 71 3
01JUL2020 32 3
01AUG2020 24 2
01SEP2020 74 2
01OCT2020 15 3
01NOV2020 34 2
01DEC2020 65 2
;
run;
proc print data=input1;
run;
proc sgplot data=input1 ;
title "graph for input1";
series x=monthlyyear y=amount /group=type lineattrs=(thickness=1);
xaxis grid interval=month label="Month and Year";
yaxis grid valueshint label="Expenditure";
format MonthlyYear yymon7.;
run; Here is the plots that I get. I want to add refline at Apr 2016, Jun 2017, Oct 2018, Aug 2019, and Mar 2020. Since Aug and Mar are not shown in the axis, I don't know how to add refline. I'm also wonder if I'm able to add short description on those reflines. In addition, I also want to make the three lines as different dashed so that when I print it out black and white, I'm able to distinguish which line is which. Any suggestions is appreciated!!
... View more