Advanced ODS Graphics Examples


I have written a new book on advanced ODS Graphics examples. It is available as a free PDF file on the web. It is in color, and all of the SAS code is available by double clicking a link at the beginning of each example.

Advanced ODS Graphics Examples

Update: See my newest book Basic ODS Graphics Examples

I had presented an introductory tutorial on ODS Graphics for many years. Much of the tutorial material can also be found in these SAS/STAT chapters and SAS Press book that I wrote:

Using the Output Delivery System
Statistical Graphics Using ODS
ODS Graphics Template Modification
Customizing the Kaplan-Meier Survival Plot

Statistical Graphics in SAS®: An Introduction to the Graph Template Language and the Statistical Graphics Procedures

A few years ago, I presented a longer version of the tutorial that included SG annotation, axis tables, and other advanced topics. I started writing additional documentation that included these topics. The new book grew out of that effort. A few examples use the graph template language, most use PROC SGPLOT, and many use SG annotation. These are advanced examples, so if you are not familiar with ODS Graphics, start with the examples in the sources listed above.

The book has the following examples:


  • Multiple Axes, Offsets, and Drop Lines
  • Multiple Axes and Highlighted Points
  • Multiple Axes, Axis Alignment, and Many Tick Labels
  • Broken Axes
  • Multiple Plots with Equated Axes

Axis Tables

  • Axis Table Example Using PROC REG
  • Creating a Forest Plot Using PROC SGPLOT
  • Stem-and-Leaf Plot with a Box Plot
  • Axis Table Example Using PROC AUTOREG


  • Replacing Tick Labels
  • Understanding the Drawing Spaces
  • Displaying Text in a Graph
  • Drawing Lines
  • Custom Markers, No Markers, and the Data Region
  • Displaying Images in a Graph
  • Lines, Circles, Ovals, Rectangles, and Other Shapes
  • Watermarks
  • Rotating Text
  • Continuing Text
  • Shape and Scale of Arrowheads
  • Text Justification and Anchoring
  • Selecting the X, X2, Y, and Y2 Axes
  • Scaling Images
  • Adding Links to Graphs
  • SG Annotation Functions, Variables, and Their Values

Bars, Lines, Curves, and Arrows

  • Adverse Events Plot
  • Attribute Maps
  • Connecting Points with Lines, Arrows, and Curves

Plots of Labeled Points

  • Placing Labels in Scatter Plots
  • Changing How Vectors Are Displayed

Advanced Customization of Graphs That Analytical Procedures Produce

  • Changing Dynamic Variables by Using the ODS Document
  • Annotating Single-Panel Graphs That Analytical Procedures Produce
  • Annotating Multiple-Panel Graphs That Analytical Procedures Produce

About Author

Warren F. Kuhfeld

Distinguished Research Statistician

Warren F. Kuhfeld is a distinguished research statistician developer in SAS/STAT R&D. He received his PhD in psychometrics from UNC Chapel Hill in 1985 and joined SAS in 1987. He has used SAS since 1979 and has developed SAS procedures since 1984. Warren wrote the SAS/STAT documentation chapters "Using the Output Delivery System," "Statistical Graphics Using ODS," "ODS Graphics Template Modification," and "Customizing the Kaplan-Meier Survival Plot." He also wrote the free web books Basic ODS Graphics Examples and Advanced ODS Graphics Examples.

Related Posts


  1. Kannan Deivasigamani on

    Thanks for your contribution. This will be a great resource.
    Kannan Deivasigamani

  2. Many thanks for sharing your book, Advanced ODS Graphics Examples. For some reason, the following links in your blog did not work and please check.
    Using the Output Delivery System
    Statistical Graphics Using ODS
    ODS Graphics Template Modification
    Customizing the Kaplan-Meier Survival Plot

    • Warren F. Kuhfeld
      Warren F. Kuhfeld on

      Thanks Elizabeth. I absentmindedly provided links that only worked internally at SAS. They should work for you now.

  3. Pingback: Boxplot with connect - Graphically Speaking

  4. Pingback: What colors does PROC SGPLOT use for markers? - The DO Loop

Back to Top