Density curves might not scale correctly in graphics output created with PROC SGPLOT or PROC SGPANEL


Density curves might not scale correctly in graphics output created with PROC SGPLOT or PROC SGPANEL. This problem is most likely to occur if a DENSITY statement is specified without a HISTOGRAM statement.

To circumvent the problem, add a HISTOGRAM statement and set the TRANSPARENCY option to 1 to make the histogram transparent.

Below is sample code that illustrates the syntax:

proc sgplot data=test noautolegend; 
  histogram number / group=type scale=count transparency=1; 
  density number / group=type type=kernel scale=count name='density'; 
  keylegend 'density'; 
run;