Data visualization with SAS programming

How to make graph area wider in proc sgplot

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 146
Accepted Solution

How to make graph area wider in proc sgplot

[ Edited ]

Hi all,

 

Could you please advise how to make Graph area wider in Proc sgplot. Or should it be defined somewhere else? I have attached my actual code below as well.

 

Is it possible that the position of legend is not working (not in 'topright') due to incorrect width of the figure.

 

 

Thank you!

 

6.jpg

                                                   
proc sgplot data=F1 ;
    styleattrs datacontrastcolors=(black)
             datasymbols=(trianglefilled circlefilled squarefilled diamondfilled triangle circle square diamond)
             datalinepatterns=(solid); 
   scatter x=PCTPT y=mean / group=TRT01A grouporder=data
                            yerrorlower=lower                                                                                            
                            yerrorupper=upper
                            name = "customlegend" legendlabel = "Treatment";                                                                                    
   series x=PCTPT y=mean / ;

   xaxis type=discrete;
   yaxis type=linear; 

   keylegend "customlegend" / title = "Cohort dose" location=inside position=topright;
   format PCTPT $PCTPTF.;                                                                   
run;  

 


Accepted Solutions
Solution
‎11-03-2017 12:25 PM
SAS Super FREQ
Posts: 375

Re: How to make graph area wider in proc sgplot

Posted in reply to DmytroYermak

ods graphics on / width=8in height=5in;

 

Specify both height and width.  If you specify one, the other scales proportionately.

View solution in original post


All Replies
Solution
‎11-03-2017 12:25 PM
SAS Super FREQ
Posts: 375

Re: How to make graph area wider in proc sgplot

Posted in reply to DmytroYermak

ods graphics on / width=8in height=5in;

 

Specify both height and width.  If you specify one, the other scales proportionately.

Frequent Contributor
Posts: 146

Re: How to make graph area wider in proc sgplot

Posted in reply to WarrenKuhfeld

Thank you!

Frequent Contributor
Posts: 146

Re: How to make graph area wider in proc sgplot

Posted in reply to DmytroYermak

Final code (if someone is interested):

proc sgplot data=F1 noautolegend;

   styleattrs datacontrastcolors=(black)
               datasymbols=(trianglefilled circlefilled squarefilled diamondfilled triangle circle square diamond)
               datalinepatterns=(solid); 

   scatter x=PCTPT y=mean / group=TRT01A
							grouporder=data
                            yerrorlower=lower                                                                                            
                            yerrorupper=upper
                            name = "Scatter" ;                                                                               
   series x=PCTPT y=mean /  markers group=TRT01A name = "Series";

   xaxis type = discrete;
   yaxis type = log;

   keylegend "Series"  / location=outside position=topright across=1 noborder;
   format PCTPT $PCTPTF.;
 
run;  
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 123 views
  • 0 likes
  • 2 in conversation