BookmarkSubscribeRSS Feed
happy_mouth
Obsidian | Level 7

Hi there,

 

I'm using SAS 9.4. I was wondering if there is a way to adjust the vertical space between elements when plotting using ODS PowerPoint. In my dummy example, I would like to decrease the space between Title2 and Title3 (the "legend"). I'd also like to decrease the space between the last plot row and Footnote1, and the spaces between the three footnotes in general.

 

I've tried some of the suggestions for the other output destinations but I haven't gotten them to work for PowerPoint.

 

Thanks!

 

Below is the output and the code.

 

 

SAS Results Graph5.PNG

 

 

data AllMVariables;
	length variablename $25 measure $10;
	infile datalines dlm=' ' dsd;
	input variablename $ measure $ macvalue measurey;
	datalines;
"Dummy Var1" "Boston" 1.62 0
"Dummy Var1" "Boston" 123 0
"Dummy Var1" "Denver" 1.70 10
"Dummy Var1" "Denver" 3.56 10
"Dummy Var1" "Denver" 8.9 10
"Dummy Var1" "Denver" 9.9 10
"Dummy Var1" "Denver" 13.9 10
"Dummy Var1" "Denver" 33.9 10
"Dummy Var1" "Denver" 43.9 10
"Dummy Var1" "Denver" 82.9 10
"Dummy Var1" "Denver" 100 10
"Dummy Var1" "Seattle" 4 20
"Dummy Var1" "Seattle" 75 20
"Dummy Var2 Lag4" "Boston" 12.62 0
"Dummy Var2 Lag4" "Boston" 16.60 0
"Dummy Var2 Lag4" "Denver" 1.80 10
"Dummy Var2 Lag4" "Denver" 3.80 10
"Dummy Var2 Lag4" "Seattle" 4 20
"Dummy Var2 Lag4" "Seattle" 75 20
"Dummy Var3 Lag4" "Boston" 12.62 0
"Dummy Var3 Lag4" "Boston" 80.60 0
"Dummy Var3 Lag4" "Denver" 3.56 10
"Dummy Var3 Lag4" "Denver" 2.05 10
"Dummy Var3 Lag4" "Denver" 3.02 10
"Dummy Var3 Lag4" "Seattle" 4 20
"Dummy Var3 Lag4" "Seattle" 75 20
"Dummy Var4" "Boston" 1.62 0
"Dummy Var4" "Boston" 95.60 0
"Dummy Var4" "Denver" 1.70 10
"Dummy Var4" "Denver" 2.05 10
"Dummy Var4" "Denver" 2.02 10
"Dummy Var4" "Seattle" 4 20
"Dummy Var4" "Seattle" 75 20
"Dummy Var5" "Boston" 1.62 0
"Dummy Var5" "Boston" 5.60 0
"Dummy Var5" "Denver" 1.80 10
"Dummy Var5" "Denver" 3.56 10
"Dummy Var5" "Denver" 3.55 10
"Dummy Var5" "Denver" 2.09 10
"Dummy Var5" "Denver" 2.05 10
"Dummy Var5" "Denver" 2.02 10
"Dummy Var5" "Seattle" 4 20
"Dummy Var5" "Seattle" 75 20
"Dummy Var6" "Boston" 1.62 0
"Dummy Var6" "Boston" 5.60 0
"Dummy Var6" "Denver" 1.80 10
"Dummy Var6" "Denver" 3.56 10
"Dummy Var6" "Denver" 3.55 10
"Dummy Var6" "Denver" 2.09 10
"Dummy Var6" "Denver" 2.05 10
"Dummy Var6" "Denver" 2.02 10
"Dummy Var6" "Seattle" 4 20
"Dummy Var6" "Seattle" 75 20
"Dummy Var7" "Boston" 1.62 0
"Dummy Var7" "Boston" 5.60 0
"Dummy Var7" "Denver" 1.80 10
"Dummy Var7" "Denver" 3.56 10
"Dummy Var7" "Denver" 3.55 10
"Dummy Var7" "Denver" 2.09 10
"Dummy Var7" "Denver" 2.05 10
"Dummy Var7" "Denver" 2.02 10
"Dummy Var7" "Seattle" 4 20
"Dummy Var7" "Seattle" 75 20
"Dummy Var8" "Boston" 20400.28988 0
"Dummy Var8" "Boston" 20756.60893 0
"Dummy Var8" "Denver" 18752.23222 10
"Dummy Var8" "Denver" 18839.36443 10
"Dummy Var8" "Denver" 19005.232 10
"Dummy Var8" "Denver" 19237.121 10
"Dummy Var8" "Denver" 19290.2343 10
"Dummy Var8" "Denver" 19482.2323 10
"Dummy Var8" "Denver" 19492.1212 10
"Dummy Var8" "Denver" 19923.23233 10
"Dummy Var8" "Denver" 20019.02223 10
"Dummy Var8" "Seattle" 18882.232 20
"Dummy Var8" "Seattle" 21293.222 20
;
run;

%let localProjectPath =
%sysfunc(substr(%sysfunc(dequote(&_CLIENTPROJECTPATH)), 1,
%sysfunc(findc(%sysfunc(dequote(&_CLIENTPROJECTPATH)), %str(/), -255 )))); 

libname DC "&localProjectPath";
goptions htitle=9pct htext=6pct;

;
options nodate nonumber;
proc template;
   define style styles.mystyle;
      parent = styles.powerpointlight;
      style SystemTitle / 
         fontsize=20pt color=dagry fontfamily = "Albany AMT" fontweight = bold;
	  style graphfonts from graphfonts / 
      'GraphDataFont' = ("Albany AMT, <MTsans-serif>",7pt)               
      'GraphUnicodeFont' = ("<MTsans-serif-unicode>",9pt)                  
      'GraphValueFont' = ("Albany AMT, <MTsans-serif>",9pt)              
      'GraphLabel2Font' = ("Albany AMT, <MTsans-serif>",10pt)            
      'GraphLabelFont' = ("Albany AMT, <MTsans-serif>",10pt)             
      'GraphFootnoteFont' = ("Albany AMT, <MTsans-serif>",10pt)          
      'GraphTitleFont' = ("Albany AMT, <MTsans-serif>",11pt,bold)        
      'GraphTitle1Font' = ("Albany AMT, <MTsans-serif>",14pt,bold)       
      'GraphAnnoFont' = ("Albany AMT, <MTsans-serif>",10pt);             
end;
run;

ods powerpoint file="/u1/ccar/reporting_dave/testinggraphs.pptx" nogfootnote dpi=300 style=styles.mystyle;
/*Rows =8 forces A SECOND GRID PAGE*/
title1  height=20pt "This is the title of the dummy slide" ;
title2	 color=red height=13pt italic justify=left font = "Albany AMT, Arial" "In general, this is the second dummy title 
which is a very long text string that doesn't say anything interesting but takes up space";
title3 bspace=2pt box=2 c=cxFAC090 h=20pt "(*ESC*){unicode '25cf'x}" h=12pt c=black ' Boston '
 	c=cx4F6228 h=20pt "(*ESC*){unicode '25cf'x}" h=12pt c=black ' Denver '
    c=cx1F497D h=20pt "(*ESC*){unicode '25cf'x}" h=12pt  c=black ' Seattle';

footnote1 	color=black height=9pt bold justify=left	"Notes" ;
footnote2	color=black height=9pt italic justify=left "1.  Seattle data represents the data used to develop the city model.";
footnote3	color=black height=9pt italic justify=left "2.  The left and right endpoints represent, respectively, the minimum and maximum values for each variable. The additional markers on the bars represent remaining quarterly values for the city.";


ods graphics on / width=2.725in height=1.1in scale=on;
ods layout gridded columns=3 rows=8 advance=bygroup COLUMN_GUTTER=3pt /*style=styles.mystyle/*style=[backgroundcolor=Gray fontfamily= "Calibri" fontweight = bold fontsize=8pt color=black]*/;
ods region;


	/*for each variablename */
	proc sgplot data=AllMVariables uniform=group noautolegend noborder pad=0 nocycleattrs;
		by variablename;

	series x=macvalue y=measure / group = measure name="measure" grouporder=ascending attrid=myid 
		lineattrs=(pattern=solid thickness=1) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
 	series x=macvalue y=measure / group = measure name="measure" grouporder=ascending attrid=myid 
		lineattrs=(pattern=solid thickness=7) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
	scatter x=macvalue y=measure / group=measure name="measure" grouporder=ascending attrid=myid 
		 filledoutlinedmarkers markerattrs=(symbol=CircleFilled size=15) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
	/*	keylegend "measure" / BORDER POSITION=top;*/
		title "#byval1" ls=1.5 height=12pt;
	run;

ods layout end;
ods powerpoint close;
quit;
;

 

1 REPLY 1
ballardw
Super User

The TITLE option MOVE might help.

 

At this point in the day I am too lazy to try to replace all of your path and macro values to test this though.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 923 views
  • 0 likes
  • 2 in conversation