The plot visualizes trends in the data: the Android phone is gaining market share, primarily at the expense of the Blackberry, while the iPhone is holding steady.
Plotting the essential features of the data requires only two statements in the SGPLOT procedure:
title "Top Smartphone Platforms"; title2 "Total US Smartphone Subscribers, Ages 13+"; footnote "Source: comScore MobiLens service"; proc sgplot data=Mobile; series x=Date y=Pctval / group=Type break curvelabel; xaxis interval=Month; run;
- The SERIES statement plots the lines.
- The GROUP= option groups the lines according to the platform and automatically assigns unique colors for each platform.
- The BREAK option is used because the data contain a missing value for March of 2010. (The missing data is what makes this plot unusual!) If you omit the BREAK option, each line continues from the February value to the April value without interruption.
- The CURVELABEL option labels each curve in the plot. Without the option, the SGPLOT procedure would automatically insert a legend.
- The XAXIS statement causes the horizontal axis to display tick marks for each month. This statement is optional, but without the statement the plot displays ticks every three months, which I don't like.