- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everybody!
Is it possible to use a custom fill color in sgplot histogram? The code below using a hex code does not work.
proc sgplot data=aviator_demogs nocycleattrs;
histogram age_f18 / fillattrs=(color=#6394A6) name='s' binstart=20 binwidth=2 transparency=0.5;
density age_f18 /type=kernel lineattrs=(color=#6394A6);
histogram age_T45 / fillattrs=(color=LIGB) name='d' binstart=20 binwidth=2 transparency=0.5;
density age_T45 /type=kernel lineattrs=(color=LIGB);
keylegend 's' 'd' / location=inside position=topright across=1 noborder VALUEATTRS = (FAMILY = ARIAL SIZE = 8pt);
yaxis offsetmin=0 VALUEATTRS = (FAMILY = ARIAL SIZE = 8pt);
xaxis display=(nolabel) VALUEATTRS = (FAMILY = ARIAL SIZE = 8pt);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the 'CX' prefix (instead of '#') to specify hexadecimal colors:
proc sgplot data=sashelp.class nocycleattrs;
histogram age / fillattrs=(color=CX6394A6);
run;