Create the density plots. The TYPE= option specifies which density equation is used.
density cholesterol;
density cholesterol / type=kernel;
Position the Legend The LOCATION= option places the legend inside of the plot area.
The POSITION= option places the legend at the top right.
keylegend / location=inside position=topright;
run;
Cancel the title.
title;
Example 9: Creating a Horizontal Box Plot
Features:HBOX statement
Sample library
member:
SGPLBOX
This example shows a horizontal box plot.
Output
Program
proc sgplot data=sashelp.heart;
title "Cholesterol Distribution by Weight Class";
hbox cholesterol / category=weight_status; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.