## How to make graph area wider in proc sgplot

Solved
Frequent Contributor
Posts: 146

# 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!

``````
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

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

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

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

## Re: How to make graph area wider in proc sgplot

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

Thank you!

Frequent Contributor
Posts: 146

## Re: How to make graph area wider in proc sgplot

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.