Thank you for your reply. I plot a graph of observations on the y-axis and time on the x-axis in sgplot with the series statement. I then want to fill the area below the graph with a pattern. This could of course be done with a band statement, but I want to achieve a kind of zig-zag pattern; lines of the pattern go up from Time 1 to Time 2, down from Time 2 to Time3, up from Time 3 to Time. I didnt's see an easy way with the band statement, so I thouth to give it a try with annotating. I am programming the annotate data set from scratch (so not using the macros). Instead of a pattern, I now use alternating colors. This is the code: function = "polygon"; x1 = Time1; y1 = 0; if mod(_N_, 2) = 0 then do; fillcolor = "cx3B5DAD"; end; else do; fillcolor = "cx393547"; end; filltransparency = 0.5; display = "fill"; layer = "back"; x1space = "datavalue"; y1space = "datavalue"; output; function = "polycont"; x1 = Time2; y1 = 0; output; function = "polycont"; x1 = Time2; y1 = Obs2; output; if _N_ > 1 then do; function = "polycont"; x1 = Time1; y1 = Obs1; output; end;
... View more