I want to make a graph with shaded areas according to percentiles. However, when I try to apply your code (see below) I end up with white bars between different percentiles. Is there a way to make the entire graph shaded according to percentiles without any overlap?

proc univariate data=ttrdata_spline;
var ttr_mgdl;
histogram ttr_mgdl / kernel outkernel=KerDensity;
ods select histogram quantiles;
run;

%let group1 = 18.9; /* empirical 5th percentile */
%let group2 = 24.8; /* empirical 25th percentile */
%let group3 = 28.6; /* empirical 50th percentile */

data KerDensity;
set KerDensity;
if _VALUE_<&group1 then up1 = _DENSITY_; else up1 = .;
if &group1=<_VALUE_<&group2 then up2 = _DENSITY_; else up2 = .;
if &group2=<_VALUE_=&group3 then up4 = _DENSITY_; else up4 = .;
run;

title "Kernel Density with Colored Percentiles";
proc sgplot data=KerDensity;
series x=_VALUE_ y=_DENSITY_ / legendlabel="Density";
band x=_VALUE_ upper=up1 lower=0 / fillattrs=GraphData1 legendlabel="50th percentile";
xaxis label="Transthyretin (mg/dL)" LABELATTRS=(weight=BOLD);
yaxis Label="Density" LABELATTRS=(weight=BOLD);
run;

Thanks,
Anders