Refline 120 130 / axis=y label= ( 'Elevated' 'Hypertensive' ) lineattrs=GraphData2 Refline 200 240 / axis= x label= ( 'Borderline' 'High' ) lineattrs=GraphData2 Heatmap x=Cholesterol y=Systolic / colormodel= (CXDEEBF7 CX9ECAE1 CX3182BD ) Title "Clinical Ranges of Systolic Blood Pressure and Cholesterol" The following example adds labels to the previous example. LABELPOS= option to specify whether the label is displayed at the top or bottom (for a vertical reference line) orĪt the left or right (for a horizontal reference line). I like "outside" (the default) because then the line does not interfere with the label. LABELLOC= option to put the label inside or outside the data area of the graph. You can use the LABEL= option to specify one or more labels. If you might want to add a label to the reference lines,
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.
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. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.Data tell a story. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function.