For SAS 9.2, there is no way to remove an item from the legend. You just have to avoid adding it as suggested by Karel. You will need to separate out the groups you don't want in the legend. So, if you want group A, B and C, but not D and E, then you need two VLINE statements, with separate columns. Then, add only the one that you want to the KEYLEGEND statement. By default, CYCLEATTRS will still increment the attributes for each curve.
Because there are several variables with different groups in the dataset. I need the calculate the proportion change for each group in each variable. Therefore I developed a macro to calculate , and plot each variable with different group at once.
series statement definitely is not a nice way for my purpose, as I have to input the groups one by one for each variable.
As there is no way to eliminate it.. then I will leave it.
SG procedures are designed to surface the most commonly used features of Graph Template Language (GTL) in a procedure syntax. They do not surface all features from GTL. To customize each axis fonts individually, you have to use GTL. As a start, use the procedure option TMPLOUT=filename to get the GTL syntax for your SGPLOT program.
Then, on LAYOUT OVERLAY statement, you can set XAXISOPTS and YAXISOPTS suboptions to set the LABELATTRS= and TICKVALUEATTRS=. Within these options you can set the various font attributes.
On the DISCRETELEGEND statement, you can set TITLEATTRS= and VALUEATTRS= to get the customizations you need.
Note: in GTL, your VLINE statement will be transcoded as SERIESPLOT statement. If you are not familiar with GTL, there are many papers on support web site to get you started. Also, see the GTL users guide under the SAS/GRAPH doc.
(where=(date >= "01jan2000"d and stock = "IBM"));
grp = "close"; y = close; output;
grp = "low" ; y = low; output;
grp = "close"; z = high; output; /* "high" group masked as "close"*/
proc sort data=xxx;
by grp date;
proc sgplot data=xxx;
title "Stock Trend";
vline date / response = y group=grp;
vline date / response = z group=grp lineattrs=(color=red);