BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Multipla99
Quartz | Level 8

The code below generates the horisontal bar chart in the picture. Within the code, in the xaxis statment the labelpos option place the xaxis label to the right. However, I would like to fine adjust the position of the xaxis label and place it a little bit to the left and below the row of thick values. Is this possible?    

 

ods _all_ close;
ods listing 
	image_dpi 	  = 300                                              
	gpath		  = "C:\Temp"
	style 		  = styles.listing
;
ods graphics on /                       
	reset     = all
	outputfmt = png                       
	imagename = "Supportcommunity"    		
	scale     = on                        
	height    = 15cm                       
	width     = 12cm                      
;
title "Car sales sum of invoice"
; proc sgplot data= sashelp.cars; hbar type / group= origin groupdisplay= cluster response= Invoice; xaxis valuesformat=COMMA12.0 label='US $' labelpos= right grid offsetmax= 0.05; yaxis labelpos=top; keylegend / location=inside position= bottomright down=3 outerpad=(right=22 bottom=15); run ; title; footnote; ods graphics off; ods pdf close; ods listing close;

 

How can I fine adjust the position of the xaxis label?How can I fine adjust the position of the xaxis label?

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Just pad lots of blanks before "$US"?

 

title "Car sales sum of invoice";
proc sgplot 
	data= sashelp.cars;
	hbar type													
		/ 
		group= origin 									
		groupdisplay= cluster 					
		response= Invoice;
	xaxis valuesformat=COMMA12.0 	  
		label="                                                                                    US $"						
		grid                      
		offsetmax= 0.05;
	yaxis labelpos=top;
	keylegend / location=inside 			
		position= bottomright 
		down=3 								
		outerpad=(right=22 bottom=15);
run
;

View solution in original post

5 REPLIES 5
Ksharp
Super User

Just pad lots of blanks before "$US"?

 

title "Car sales sum of invoice";
proc sgplot 
	data= sashelp.cars;
	hbar type													
		/ 
		group= origin 									
		groupdisplay= cluster 					
		response= Invoice;
	xaxis valuesformat=COMMA12.0 	  
		label="                                                                                    US $"						
		grid                      
		offsetmax= 0.05;
	yaxis labelpos=top;
	keylegend / location=inside 			
		position= bottomright 
		down=3 								
		outerpad=(right=22 bottom=15);
run
;
Ksharp
Super User

Interesting.

Padding white blanks has no effect to the generated picture "Supportcommunity.png".

But if you are using TAB characters instead of white blanks,then you could get job done.

 

ods _all_ close;
ods listing 
	image_dpi 	  = 300                                              
	gpath		  = "C:\Temp"
	style 		  = styles.listing
;
ods graphics on /                       
	reset     = all
	outputfmt = png                       
	imagename = "Supportcommunity"    		
	scale     = on                        
	height    = 15cm                       
	width     = 12cm                      
;
title "Car sales sum of invoice";
proc sgplot 
	data= sashelp.cars;
	hbar type													
		/ 
		group= origin 									
		groupdisplay= cluster 					
		response= Invoice;
	xaxis valuesformat=COMMA12.0 	  
		label="															US $"						
		grid                      
		offsetmax= 0.05;
	yaxis labelpos=top;
	keylegend / location=inside 			
		position= bottomright 
		down=3 								
		outerpad=(right=22 bottom=15);
run
;

Ksharp_0-1668247631644.png

 

Ksharp
Super User
And Don't forget remove " labelpos= right " .
Multipla99
Quartz | Level 8
Thanks a lot, Ksharp! You impressed me again!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 998 views
  • 4 likes
  • 2 in conversation