- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Coloring the xaxistable values using colorgroup and styleattrs.
First scenario, there is one color per group as specified in the styleattrs.
proc sql;
create table class as
select put(age,best.-l) as age
, case when age in (12,13) then '12-13'
when age in (14,15) then '14-15'
else 'Other'
end as agegrp
, mean(height) as mean_height
from sashelp.class
group by age;
quit;
proc print data=class noobs;
run;
proc sgplot data=class;
vbarbasic age / response=mean_height;
xaxistable mean_height / colorgroup = agegrp;
styleattrs datacontrastcolors=(black green red);
run;
Second scenario, only the non missing groups take a color given in styleattrs.
proc sql;
create table class as
select put(age,best.-l) as age
, case when age in (12,13) then '12-13'
when age in (14,15) then '14-15'
else ' ' /*different from scenario 1*/
end as agegrp
, mean(height) as mean_height
from sashelp.class
group by age;
quit;
proc sgplot data=class;
vbarbasic age / response=mean_height;
xaxistable mean_height / colorgroup = agegrp;
styleattrs datacontrastcolors=(/*black*/ green red);
run;
Is there an option to control the color of xaxisvlues for the missing value of the variable given in colorgroup while using styleattrs?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
By default, the missing color is special, and it is retrieved from the active ODS style. However, if you use an attributes map instead of STYLEATTRS, you can control all of the colors, including "missing".
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
By default, the missing color is special, and it is retrieved from the active ODS style. However, if you use an attributes map instead of STYLEATTRS, you can control all of the colors, including "missing".
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content