

You can display labels for reference lines. You can display a line to indicate a reference value or a sample statistic. This article shows several ways to use the REFLINE statement in PROC SGPLOT to add information to your graphs. Although you can use the COLORBANDS= option on the YAXIS statement to add alternating bands of colors to a graph, the REFLINE statement enables you to add lines that are not strictly alternating or that vary in width.Use reference lines to highlight a category of interest.Sanjay Matange shows two creative uses for reference lines for a discrete axis: Labelloc=inside label= "Fiscal /Year " splitchar= "/" /* split label */īecause you can control the thickness of the reference lines, you can use them for many purposes.

Refline "19Q2" / axis= x discreteoffset= 0.5 /* move ref line to right */ * for a discrete variable, specified the formatted value */

If you might want to add a label to the reference lines,
#Jmp graph builder labels how to#
In this example, I used the optional LINEATTRS= option to show how to change the color, line pattern, and thickness of the reference lines. Put REFLINE stmt first if you want it behind the bars */ run Refline 200 240 / axis= x lineattrs= (thickness= 3 color=darkred pattern=dash ) Set sashelp.Heart ( where= (Cholesterol< 400 ) ) You can use reference lines to indicate good, borderline, and high cholesterol. The following histogram shows the distribution of cholesterol values for 5,195 subjects. The Sashelp.Heart data set contains cholesterol and blood pressure information for patients in a heart study. A cholesterol level that is 240 or more is considered high. A "borderline" (or moderately elevated) cholesterol level is between 200 and 240 mg/dL. The reference lines are perpendicular to the axis.Ī simple use of a reference line is to indicate a reference value on a histogram.įor example, a healthy total cholesterol level is less than 200 mg/dL. You then use the AXIS=X or AXIS=Y option to specify which axis the reference lines are for. You can specify one or more values (separated by spaces) or you can specify a variable in the data set that contains the values at which to display the reference lines. The REFLINE statement in PROC SGPLOT is easy to use. Use reference lines for a categorical variable on a discrete axis.Display a reference line at a value such as a mean or median.This article provides multiple "Getting Started" examples that show how to use the REFLINE statement This article discusses the REFLINE statement in PROC SGPLOT in SAS. Sometimes you can let the data "speak for themselves" in an unadorned graphic, but sometimes it is helpful to add reference lines to a graph to emphasize key features of the data. A purpose of data visualization is to convey that story to the reader in a clear and impactful way.
