The SAS Output Delivery System and reporting techniques

ODS pdf : truncated graph

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

ODS pdf : truncated graph

Hi all

I've been scratching my haed for a while now re: ODS pdf

I am using ODS pdf a lot but ths time there is something I can't solve: the grph I output in the pdf is truncated on the left and the right side. I have played a lot with hsize and vsize and it seem to do their job, but the graph inside the defined area appear too big for the area. I was wondering if there was something like 'scaling' the graph to the hsize x vsize area or something clever to correct this.

I have paste the code and attached the output

Cheers!

 

 option orientation=portrait leftmargin="1.0cm" rightmargin="1.0cm" topmargin="1.0cm" bottommargin="1.0cm" papersize=A4 formdlim=' ' center ;
 ODS ESCAPECHAR='^'; 
 ods pdf file="C:\temp\test_&datef..pdf" style=statdoc startpage = never notoc ;
 Title1 j=c h=5 f=arialb c=vib "Title1" ; 
 title2 " " ; 
 Title3 j=r h=2 f=arial c=vib "Done &datef." ; 
 title4 " " ; 

 *** page 1 ;
 ods pdf style = statdoc text = "^S={just=l font_weight=light font_size=12pt font_face=Arial foreground=vib}2a. Comment1" ; 
 symbol h= 1 ;
 goptions hsize=10cm vsize=10cm vorigin=15.0cm horigin=5.0cm border autosize=on DEV=SASPRTC ;
 axis1 value=(h=1 f=swiss) label=(h=1.5 f=swissb "PureBreed Only") ;
 axis2 value=(h=1 f=swiss) label=(a=90 h=1.5 f=swissb "PureBreed + CrossBred") ;
 title1 h=2 f=swissb c=black "Graph title" ;
 title3 h=0.7 " " ;
 legend1 value=(h=1 f=swiss) label=(h=1 f=swissb "Country of origin") ; 
 proc gplot data = graph ;
 plot xebv_wwt*ebv_wwt / haxis=axis1 vaxis=axis2 grid nolegend frame ; run ; quit ;

 ods pdf close ;

Accepted Solutions
Solution
‎07-04-2017 06:17 AM
Occasional Contributor
Posts: 11

Re: ODS pdf : truncated graph

@RW9

Thanks again. I'll try that alright.

Cheers!

View solution in original post


All Replies
Super User
Super User
Posts: 7,392

Re: ODS pdf : truncated graph

This page might help, ods graphics / height=...;

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_odsgraph_se...

 

Note however it may not work with the gplot, which is the old graphing system (pre version 9).  Would really recommend moving to sgplot/GTL.  If you need examples this blog is my goto for any graphing information:

http://blogs.sas.com/content/graphicallyspeaking/

Occasional Contributor
Posts: 11

Re: ODS pdf : truncated graph

@RW9

many thanks for the quick reply - I am battleing here to get SAS Graph ... I am using the BASE STAT package so no SGPLOT for me. 

It's really the PDF output that's truncated ; if I print the graph on-screen it looks very OK.

Something to do with maybe defining the printer ? 

 

Very nice blog you have - I have it bookmarked now :-)

Cheers

Super User
Super User
Posts: 7,392

Re: ODS pdf : truncated graph

Errm, assuming your using 9.2 or later then you should have access to this already, if your on a previous verison of SAS to that there really isn't any reason not to upgrade, from > 9.0 it was just additions.

Yes, Sanjay who started that blog really does give good clear examples on pretty mch any graph you can think of, and with overlays and tiling and such like you can get some real nice outputs.  

 

Going back to your problem, you can try:

ods graphics on / width=4.5in  height=3.5in;

It sounds like the image size being created is too big for the PDF age, does it do the same when you output to RTF?  Am just thinking that for most graphs I create I goto RTF first, then convert the RTF to PDF.

Otherwise can't help much more as not used gplot in years. 

Solution
‎07-04-2017 06:17 AM
Occasional Contributor
Posts: 11

Re: ODS pdf : truncated graph

@RW9

Thanks again. I'll try that alright.

Cheers!

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 442 views
  • 2 likes
  • 2 in conversation