Controlling Titles. Purpose: This chapter demonstrates how to control various characteristics of the titles in your graphs.

Similar documents
INTRODUCTION TO THE SAS ANNOTATE FACILITY

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

It s Not All Relative: SAS/Graph Annotate Coordinate Systems

Splitting Axis Text. Splitting Text in Axis Tick Mark Values

Tips to Customize SAS/GRAPH... for Reluctant Beginners et al. Claudine Lougee, Dualenic, LLC, Glen Allen, VA

Effective Forecast Visualization With SAS/GRAPH Samuel T. Croker, Lexington, SC

Coders' Corner. Paper ABSTRACT GLOBAL STATEMENTS INTRODUCTION

USING SAS PROC GREPLAY WITH ANNOTATE DATA SETS FOR EFFECTIVE MULTI-PANEL GRAPHICS Walter T. Morgan, R. J. Reynolds Tobacco Company ABSTRACT

Tips for Producing Customized Graphs with SAS/GRAPH Software. Perry Watts, Fox Chase Cancer Center, Philadelphia, PA

Using Annotate Datasets to Enhance Charts of Data with Confidence Intervals: Data-Driven Graphical Presentation

ABSTRACT INTRODUCTION SESUG RV

Multiple Forest Plots and the SAS System

Creating Maps in SAS/GRAPH

THE IMPACT OF DATA VISUALIZATION IN A STUDY OF CHRONIC DISEASE

Using SAS to map petroleum distributions. Saskatoon SUCCESS SAS User Group October 18 th, 2012

Purpose: This chapter demonstrates how to create pie charts, and discusses some of the issues to consider when deciding whether to use a pie chart.

Modifying Graphics in SAS

Put Your Data on the Map: Using the GEOCODE and GMAP Procedures to Create Bubble Maps in SAS

How to Make an Impressive Map of the United States with SAS/Graph for Beginners Sharon Avrunin-Becker, Westat, Rockville, MD

Innovative Graph for Comparing Central Tendencies and Spread at a Glance

ABC s of Graphs in Version 8 Caroline Bahler, Meridian Software, Inc.

Create Flowcharts Using Annotate Facility. Priya Saradha & Gurubaran Veeravel

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

PharmaSUG 2012 Paper CC13

HOUR 12. Adding a Chart

Graphical Techniques for Displaying Multivariate Data

SAS: Proc GPLOT. Computing for Research I. 01/26/2011 N. Baker

Microsoft Excel 2000 Charts

SAS Graph: Introduction to the World of Boxplots Brian Spruell, Constella Group LLC, Durham, NC

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

Move =(+0,+5): Making SAS/GRAPH Work For You

Introductory SAS example

Homework 1 Excel Basics

A Dynamic Imagemap Generator Carol Martell, Highway Safety Research Center, Chapel Hill, NC

Data Explore Matrix Quality Control by Exploring and Mining Data in Clinical Study

Editing Webpages in N/Vu

Presentation Quality Graphics with SAS/GRAPH

Paper SIB-096. Richard A. DeVenezia, Independent Consultant, Remsen, NY

How to annotate graphics

Working with Charts Stratum.Viewer 6

Using SAS Graphics to Explore Behavioral Health Cost Risk Barbara B. Okerson, HMC, Richmond, VA

... WHERE. AnnotaI8 Data.S... XSYS & YSYS. Harie Annotate: How Not to Lose Your Head When Enhancing BAS/GRAPH output

How to Make Graphs with Excel 2007

Custom Map Displays Created with SAS/GRAPH Procedures and the Annotate Facility Debra Miller, National Park Service, Denver, CO

Taming the Box Plot. Sanjiv Ramalingam, Octagon Research Solutions, Inc., Wayne, PA

Chemistry 30 Tips for Creating Graphs using Microsoft Excel

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

Paper S Data Presentation 101: An Analyst s Perspective

Tricking it Out: Tricks to personalize and customize your graphs.

Creating and Modifying Charts

Arthur L. Carpenter California Occidental Consultants

Making Tables and Graphs with Excel. The Basics

The Basics of Map Creation with SAS/GRAPH. Mike Zdeb School of Public Health Rensselaer, NY

Form Design. Software Engineering CSCI Dr. Tom Hicks Computer Science Department

Excel Tips and FAQs - MS 2010

Introduction to Minitab 1

The GANNO Procedure. Overview CHAPTER 12

Fly over, drill down, and explore

Fiqure 1. Graphics 229. NESUG '93 Proceedings

Creating Regional Maps with Drill-Down Capabilities Deb Cassidy Cardinal Distribution, Dublin, OH

Tips and Tricks in Creating Graphs Using PROC GPLOT

MS Word Professional Document Alignment

Getting Started With Excel

ODS LAYOUT is Like an Onion

The Plot Thickens from PLOT to GPLOT

DOING MORE WITH WORD: MICROSOFT OFFICE 2013

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

Creating a Website Using Weebly.com (June 26, 2017 Update)

Paper Mapping Roanoke Island Revisited: An OpenStreetMap (OSM) Solution. Barbara Okerson, Anthem Inc.

EXCEL BASICS: PROJECTS

Welcome to Introduction to Microsoft Excel 2010

SUGI 29 Posters. Paper A Group Scatter Plot with Clustering Xiaoli Hu, Wyeth Consumer Healthcare., Madison, NJ

Rafe M. J. Donahue, Ph.D. Associate Director, Statistics BioMimetic Therapeutics, Inc. Franklin, TN

Creating a Basic Chart in Excel 2007

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

MWSUG Paper DV04 SAS/GRAPH and GfK Maps: a Subject Matter Expert Winning Combination Louise S. Hadden, Abt Associates Inc.

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Detailed instructions for video analysis using Logger Pro.

Geospatial Analysis with PROC GMAP

New SAS V8 Tricks for Old SAS V6 Dogs: Tips from the Command Line Louise Hadden, Abt Associates Inc., Cambridge, MA

Reference and Style Guide for Microsoft Excel

hvpcp.apr user s guide: set up and tour

DOING MORE WITH WORD: MICROSOFT OFFICE 2007

Creating Booklets Using Microsoft Word 2013 on a PC

Microsoft Excel 2007

Power Point* Quick Start. 1. Start Power Point (PP) by 2x click on the PP icon in the program folder.

PharmaSUG 2015 Paper PO03

Computer with Microsoft Excel Printer (optional) STUDENT WORKSHEET: Using Microsoft Excel to Record Weather Observations

Converting Annotate to ODS Graphics. Is It Possible?

Here is the data collected.

Using SAS to Create Custom Healthcare Graphics Barbara B. Okerson, WellPoint, Richmond, VA

Excel Basic: Create Formulas

Excel Primer CH141 Fall, 2017

Using Microsoft Excel

Downloading 2010 Census Data

Create and edit word processing. Pages.

Picturing Statistics Diana Suhr, University of Northern Colorado

Gift Card Representations

Using Excel to produce graphs - a quick introduction:

1 Introduction to Using Excel Spreadsheets

Transcription:

CHAPTER 5 Controlling Titles Purpose: This chapter demonstrates how to control various characteristics of the titles in your graphs. The Basics For the first examples in this chapter, we ll once again use the sashelp.class dataset (which ships with SAS). Here s what the first few rows of the data look like: In SAS/GRAPH, you can use title statements to add a primary, and secondary title(s). Let s start with a simple graph that has a title1 and title2, using the default title characteristics. Notice that the title2 is much smaller than the title1, and uses the same font and size as the text in the axes of the graph. Also, the title is very close to the top edge of the graph (I have turned on a light gray border around the graph in this document so you can see where the edge of the graph is.) axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4);

SAS/GRAPH: The Basics symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 "Ms. Crabapple's Class"; title2 "Student Data"; proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2; I almost always use the title statement s linespacing option (ls=) to add some white-space above the title. Also, I frequently make the title2 a bit larger than the default text size, using the height option (h=), and change the font to bold (like the title1). axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4);

Chapter 5: Controlling Titles symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 ls=2.5 h=4.5 f='albany amt/bold' "Ms. Crabapple's Class"; title2 ls=1.0 h=4.5 f='albany amt/bold' "Student Data"; proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2; I usually go with centered titles (as is the default), but sometimes it works out better for the titles to be left-justified. You can easily control this using the title statement s justify (j=) option. We ll do this in two steps this first graph shows you what just using the j=l option gets you (titles jammed up against the left border), and then I ll show you how to add some white-space in the next graph.

SAS/GRAPH: The Basics axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4); symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 ls=2.5 j=l h=4.5 f='albany amt/bold' "Ms. Crabapple's Class"; title2 ls=1.0 j=l h=4.5 f='albany amt/bold' "Student Data"; proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2; Now let s move the titles to the right a little, so they line up with the left axis. You can accomplish this using the title statement s move= option. It usually takes a bit of trial-

Chapter 5: Controlling Titles and-error to find the numeric value that positions the text exactly where you want it in this case +10 in the x direction worked out nicely. axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4); symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 ls=2.5 j=l move=(+10,+0) h=4.5 f='albany amt/bold' "Ms. Crabapple's Class"; title2 ls=1.0 j=l move=(+10,+0) h=4.5 f='albany amt/bold' "Student Data"; proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2;

SAS/GRAPH: The Basics Now that we have the desired amount of white-space above the title, and to the left of the title, how about controlling the white-space around the rest of the graph? We can actually control that with some additional title statements! Titles can be angled so that they appear along the left and right sides of the graph, which will add more space between the right axis wall and the right edge of the graph space, for example. axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4); symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 ls=2.5 j=l move=(+13,+0) h=4.5 f='albany amt/bold' "Ms. Crabapple's Class"; title2 ls=1.0 j=l move=(+13,+0) h=4.5 f='albany amt/bold' "Student Data"; title3 a=90 h=2 "h=2 angle=90"; title4 a=-90 h=6 "h=6 angle=-90"; proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2;

Chapter 5: Controlling Titles In the example above, I left some text in the title3 and title4 statements, so you could see where these titles showed up in the graph. That was for demonstration purposes only. In real life, you would make those titles blank to that white-space is all that is visible on the left and right. Now the resulting graph is pleasantly spaced on all sides, earning a check plus axis1 order=(50 to 75 by 5) minor=none offset=(4,4); axis2 order=(50 to 150 by 25) minor=none offset=(4,4); symbol1 font='albany amt/unicode' value='2640'x h=6 interpol=none color=cxff6666; /* female */ symbol2 font='albany amt/unicode' value='2642'x h=6 interpol=none color=cx0276fd; /* male */ title1 ls=2.5 j=l move=(+13,+0) h=4.5 f='albany amt/bold' "Ms. Crabapple's Class"; title2 ls=1.0 j=l move=(+13,+0) h=4.5 f='albany amt/bold' "Student Data"; title3 a=90 h=2 " "; title4 a=-90 h=6 " ";

SAS/GRAPH: The Basics proc gplot data=sashelp.class; plot height*weight=sex / nolegend vaxis=axis1 haxis=axis2; Below is a fancier example of titles that use the move= option for better placement:

Chapter 5: Controlling Titles

SAS/GRAPH: The Basics You might sometimes want some text to stand out in a title, and one way to do that is by using a different color. This is especially useful when you re creating a series of similar graphs, and you can highlight the thing that s changing in the title. All you have to do is break the title into separate pieces of text, and specify a color= between them. Here s how you could add color to the title of the previous graph: title1 ls=2.5 j=l move=(+13,+0) h=4.5 f='albany amt/bold' "Ms. Crabapple's " c=red "Math Class"; Below are some fancier examples of titles with multiple colors:

Chapter 5: Controlling Titles

SAS/GRAPH: The Basics In order to utilize the space more efficiently, or provide an aesthetically balanced graph, you might sometimes want to have the title and the graph share the same space. These next few examples demonstrate some techniques you can use to do that. We ll use a geographical map of Texas to demonstrate, but you can use the same techniques with any type of graph that has a nice chunk of unused space. Here s a map of Texas notice that when there is no title, it sizes itself to utilize all available space: title; pattern1 v=s c=cxf0fff0; proc gmap data=my_map map=my_map; id state county; choro state / levels=1 nolegend coutline=gray77; By default the titles are at the top of the page, and the graph is automatically resized to accommodate the title text. This example has two lines of title text at the top of the page, and the Texas map is now smaller than it was without the title. It s not a bad-looking map, but there is a good bit of wasted white-space: title1 ls=1.5 "Some Title";

Chapter 5: Controlling Titles title2 f="albany amt/bold" h=5 "About Texas"; pattern1 v=s c=cxf0fff0; proc gmap data=my_map map=my_map; id state county; choro state / levels=1 nolegend coutline=gray77; Wouldn t it be great if you could move the titles into the white-space at the top-right area of the map, rather than above the map? If you re a thinking person you might be saying to yourself Hmm, perhaps I can use the move= command that we just learned about, to move the title into that location! OK let s give that a try title1 ls=1.5 move=(+20,-4) "Some Title"; title2 f="albany amt/bold" h=5 move=(+20,+0) "About Texas"; pattern1 v=s c=cxf0fff0; proc gmap data=my_map map=my_map; id state county; choro state / levels=1 nolegend coutline=gray77;

SAS/GRAPH: The Basics Well that didn t turn out so great, eh? The titles are indeed moved to the right and down, but the map is still totally below the titles, and it has shrunk to an even smaller size, and there is now even more white-space! So basically, the titles and the graph do not mix they do not share the same space. If you move the titles down, the graph gets smaller. Bummer Luckily there are always several different ways to do things in SAS/Graph so let s explore some alternate approaches. One approach is to use a note statement, rather than a title statement. With a note statement, you can specify any location to place the text, and the text can even share space with the graph. title; pattern1 v=s c=cxf0fff0; proc gmap data=my_map map=my_map; note move=(62,90.5) f="albany amt/bold" h=5 "Some Title"; note move=(60,84) f="albany amt/bold" h=5 "About Texas";

Chapter 5: Controlling Titles id state county; choro state / levels=1 nolegend coutline=gray77; Another approach is to use annotate to place the text in the desired area. Annotate is a little more work (you have to create an annotate dataset), but it provides a lot more flexibility and control than the note statement. data anno_labels; length text $100; xsys='3'; ysys='3'; hsys='3'; when='a'; function='label'; style='ablany amt/bold'; size=5; position='5'; x=75; y=92.0; text='some Title'; output; y=y-6.5; text='about Texas'; output;

SAS/GRAPH: The Basics title; pattern1 v=s c=cxf0fff0; proc gmap data=my_map map=my_map anno=anno_labels; id state county; choro state / levels=1 nolegend coutline=gray77; Below are several fancier examples where the title shares the space with the graph:

Chapter 5: Controlling Titles

SAS/GRAPH: The Basics

Chapter 5: Controlling Titles