Customizing cap widths


The SG procedures and GTL statements do a lot of work for us to display the data using the specified statements.  This includes setting many details such as arrow heads, line patterns etc, including caps.  Often, such details have a fixed design according to what seems reasonable for most use cases.  However, sometimes the default behaviors are not good enough, and users want to customize these based on their use case, requirements of various journals or their own aesthetic sense.

While the statements often provide options to customize items like marker size, bar width and other attributes, one element that did not allow customization was the width of the cap for a box plot, error bars or limit bars.  Users have often asked for control of cap widths, and with SAS 9.40M5, new options are added to address just this need.  Now, you can use CAPSCALE, ERRORCAPSCALE or LIMITCAPSCALE to adjust the width of these caps using a factor on the original width.  Here are some examples.

Box plot, with default cap width on left, and reduced cap width using CAPSCALE=0.5 on the right






Scatter plot, with default error cap width on left, and reduced caps using ERRORCAPSCALE=0.3 on the right.






VBar, with default limit cap width on left, and increased caps using LIMITCAPSCALE=2.0 on the right.






Now, you can adjust the cap widths to get your graph just right.

See full code for details:  Cap_Scale


About Author

Sanjay Matange

Director, R&D

Sanjay Matange is R&D Director in the Data Visualization Division responsible for the development and support of the ODS Graphics system, including the Graph Template Language (GTL), Statistical Graphics (SG) procedures, ODS Graphics Designer and related software. Sanjay has co-authored a book on SG Procedures with SAS/PRESS.

Related Posts

Leave A Reply

Back to Top