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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 519 views
  • 4 likes
  • 2 in conversation