Side by side 2 graphs - how to put in PDF

Reply
Frequent Contributor
Posts: 134

Side by side 2 graphs - how to put in PDF

Hi,

I am trying to put 2 graphs side by side on a single PDF page... here is the code I am using which is putting the graphs on two different pages...

OPTIONS NODATE NOCENTER FONT=ARIAL;

ods _all_ close;

ODS PDF FILE="\\Server_name\File.pdf" columns=4 startpage=no;

ODS LAYOUT START;

ods region x=0in y=.1in height=2in width =1.5in;

PROC GCHART DATA=work.TableA

;

  VBAR3D

  DAY_DATE

/

  discrete SUMVAR=VOLUME

  FRAME TYPE=SUM

SUM

  LEGEND=LEGEND1

  COUTLINE=BLACK

  RAXIS=AXIS1

  MAXIS=AXIS2

PATTERNID=MIDPOINT

  LREF=1

  CREF=BLACK

  AUTOREF

  space=0

;

format volume comma10.1;

RUN;

ods region x=0in y=.1in height=2in width =1.5in;

axis1 minor=none label=('Hrs');

axis2 minor=none label=(f='Arial/Bold' justify=center ' Days');

title1 'Scheduled Hold Time - PR';

PROC GCHART DATA=work.TableB

;

  VBAR3D

  DAY_DATE

/

  discrete SUMVAR=VOLUME

  FRAME TYPE=SUM

SUM

  LEGEND=LEGEND1

  COUTLINE=BLACK

  RAXIS=AXIS1

  MAXIS=AXIS2

PATTERNID=MIDPOINT

  LREF=1

  CREF=BLACK

  AUTOREF

  space=0

;

format volume comma10.1;

RUN;

ODS LAYOUT END;

ODS PDF CLOSE;

Super Contributor
Posts: 349

Re: Side by side 2 graphs - how to put in PDF

Hi,

Try this options,if it works or not.

options orientation=landscape papersize=A3;

Thanks,

Shiva

Frequent Contributor
Posts: 95

Re: Side by side 2 graphs - how to put in PDF

Have you tried it without using ODS LAYOUT and ODS REGION statements? You already specified columns=4 in ODS PDF statement.

I don't have your data. Using sashelp.class to illustrate the changes.

I am not sure if ODS LAYOUT is production is yet. Last I checked, it was pre-production.

If ODS LAYOUT and ODS REGION used you may need to adjust your "x" value for second ODS region to something like "x=5in.".

It looks like ODS REGION is using absolute position for "x" and "y" in the page.

ods _all_ close;

ODS PDF FILE="d:\temp\File.pdf" columns=4 startpage=no;

*ODS LAYOUT START;

*ods region x=0in y=.1in height=2in width =1.5in;

PROC GCHART DATA=sashelp.class;

  VBAR3D

  Sex

/

  discrete SUMVAR=Height

  FRAME TYPE=SUM

SUM

  NOLEGEND

  COUTLINE=BLACK

PATTERNID=MIDPOINT

  LREF=1

  CREF=BLACK

  AUTOREF

  space=0

;

RUN;

*ods region x=5in y=.1in height=2in width =1.5in;

PROC GCHART DATA=sashelp.class;

  VBAR3D

  Sex

/

  discrete SUMVAR=Weight

  FRAME TYPE=SUM

SUM

  NOLEGEND

  COUTLINE=BLACK

PATTERNID=MIDPOINT

  LREF=1

  CREF=BLACK

  AUTOREF

  space=0

;

RUN;

*ODS LAYOUT END;

ODS PDF CLOSE;

Ask a Question
Discussion stats
  • 2 replies
  • 284 views
  • 0 likes
  • 3 in conversation