This procedure is used to create statistical graphics such as histograms and regression plots, in addition to simple graphics such as scatter plots and line plots. Statements and options enable you to control the appearance of your graph and add additional features such as legends and reference lines. You can have two graphs in the same chart, for example having a scatter plot with the confidence limit ellipse plot on the same chart would be something nice to look at. in the code below, area, year, and weather are categorical variables, and aadt and count are continuous variables.
proc sort data=dataname1; by area; run;
proc sgplot data=dataname1;
*----------------------------------;
vbox aadt /category = area
datalabel
labelfar
name = "first vertical box plot"
transparency = 0.5
x2axis
y2axis;
*----------------------------------;
scatter y=count x=weather
/datalabel
markerattrs=(size=2)
transparency = 0.5
name = "my first scatter plot"
group=area
x2axis
y2axis;
*----------------------------------;
vbar count /alpha=0.1
barwidth=1
datalabel
nofill
fillattrs=(color=blue)
group=year
name = "My bar plot"
nooutline
transparency=0.2;
*----------------------------------;
histogram aadt /name = "My bar plot"
boundary=upper
nofill
fillattrs=(color=brown)
transparency=0.2
scale=count
showbins
x2axis
y2axis;
*----------------------------------;
ellipse y=count x=weather
/alpha=0.1
fill
fillattrs=(color=red)
outline
lineattrs=(thickness=5 color=black)
transparency=0.4;
*----------------------------------;
inset "My Plot" /border
labelalign=center
position= se
textattrs=(color=red size=20);
run;