Data visualization with SAS programming

Plot Size Affected by Titles and Footnotes with Proc Lifetest

Reply
Occasional Contributor
Posts: 6

Plot Size Affected by Titles and Footnotes with Proc Lifetest

Good morning,

I having trouble adjusting the plot size when I start adding titles and footnotes to my output. The code below works just as expected, with the plot size being 9 inches wide by 6.5 in tall. Adding a single title and footnote however reduces the plot size to 6.75 inches wide by 5 inches tall. The problem becomes much worse with the full set of titles and footnotes that I need for the ultimate graph, and by the time the legend is added the graph becomes very small.

With all titles and footnotes the available page area is 4.25in height by 9in width. Using these values for DesignWidth and DesignHeight yields a graph that is 3.25in high by 5.75in wide and has 1.5in unused white space between the graph and the footnotes. Is part of the page simply unavailable to be used? I haven't found a combination of BeginGraph or ODS Graphics options that solves the problem. Annotation doesn't seem to be an alternative, and the Note statement with its move=(x,y) option is not available for ods graphics. Any suggestions would be appreciated.

I have a SAS 9.3 with 64-bit Windows installation.

Thanks in advance,

Les

*==== Code ============;

ods pdf file  = 'C:\Proc Lifetest.pdf'

        style = plateau

        notoc

        startpage = never;

    options;

    options  orientation=landscape papersize=letter  pdfpageview=actual;

    options  linesize=148          nonumber nodate   pagesize=500;

    options  topmargin=1in         rightmargin=1in   bottommargin=1in   leftmargin=1in;

proc template;

    options  linesize=148;

    define style thisgraph;

        parent = styles.plateau;

    end;

    source Stat.Lifetest.Graphics.ProductLimitSurvival;

    define StatGraph Stat.Lifetest.Graphics.ProductLimitSurvival;

       dynamic NStrata xName plotAtRisk plotCensored plotCL plotHW plotEP labelCL labelHW labelEP

               maxTime xtickVals xtickValFitPol method StratumID classAtRisk plotBand plotTest

               GroupName yMin Transparency SecondTitle TestName pValue _byline_ _bytitle_ _byfootnote_;

       BeginGraph / DesignHeight=6.5in  DesignWidth=9.0in;

             layout overlay / xaxisopts=(label      = "Time" offsetmin=0

                                         linearopts = (viewmax=700.5 tickvaluelist=XTICKVALS tickvaluefitpolicy=XTICKVALFITPOL))

                              yaxisopts=(label      =  "Survival" shortlabel="Survival"

                                         offsetmin  =  0 offsetmax=0 griddisplay=on

                                         linearopts = (tickvaluelist=(0 .2 .4 .6 .8 1.0) viewmin=0 viewmax=1

                                                       tickvalueformat=percent8.));

                bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / group=STRATUM index=STRATUMNUM modelname="Survival"

                                                                      datatransparency=Transparency;

                stepplot y=SURVIVAL x=TIME / name     =  "Survival"

                                             primary  =  true

                                             group    =  STRATUM index=STRATUMNUM

                                             rolename = (_tip1=ATRISK _tip2=EVENT)

                                             display  =  all

                                             tiplabel = (_tip1="Number at Risk" _tip2="Observed Events") tip=(x y _tip1 _tip2);

                referenceline  y = .5;

             endlayout;

       EndGraph;

    end;

    run;

    ods pdf style=thisgraph;

        ods exclude all;

        ods select survivalplot;

        ods noproctitle;

    proc lifetest  data=sashelp.BMT method=KM notable outsurv=survival;

        time t * status(0);

        survival plots=survival(nocensor strata=overlay cb=hw);

        strata group;

        run;

        quit;

ods pdf close;

*==== End Code ============;

Ask a Question
Discussion stats
  • 0 replies
  • 310 views
  • 0 likes
  • 1 in conversation