# Re: st: -graph combine- question

 From Michael McCulloch To statalist@hsphsun2.harvard.edu Subject Re: st: -graph combine- question Date Thu, 22 Oct 2009 20:12:24 -0700

```Dear Kieran,
I created for a recent project a code that combines four Kaplan-Meier
graphs, named:
PSSS_II_KM.gph,
PSSS_IIIA_KM.gph
PSSS_IIIB_KM.gph
PSSS_IV_KM.gph
then combined them in the step below named "FIGURE 1". I defined the x-
axis with the two options xmtick and xlabel. Hope this helps.
Michael

* KM, stage IV
sts graph if stage==5, by(grouplevel) saving("PSSS_IV_KM", replace )
tmax(120) ///
title("Stage IV") ///
legend(label(1 "PS, PAM+V long-term") label(2 "PS, PAM+V short-term")
label(3 "KPNC") label(4 "CCR")) ///
lpattern(l - dot _) lcolor(black black black black) xtitle("Survival
time in months") ///
l2title("Percent surviving") xmtick(0(10)120) xlabel(0(50)100)
censored(single)

* FIGURE 1: KM, txloc all stages by stage, combined into one graph
graph combine 	PSSS_II_KM.gph ///
PSSS_IIIA_KM.gph ///
PSSS_IIIB_KM.gph ///
PSSS_IV_KM.gph, ///
saving("lung_PSSS_II-IV_KM_ALLLEVELS", replace ) rows(2) cols(2)
iscale(0.5)
graph export "Fig_1_PSSS_ALL_TXLEVELS.tif", replace

On Oct 22, 2009, at 7:32 PM, Kieran McCaul wrote:

> ....
>
> Suppose I have four graphs that I combine to look like this:
>
> http://i37.tinypic.com/314wkfb.jpg
>
> My question is: is there an easy way to ensure that the length of the
> x-axis is the same in all four graphs when they are combined.
>
> I can probably fiddle around with margin gaps until I get them right,
> but is there something a little easier than that?
>
> Thanks.
>
>
> ______________________________________________
> Kieran McCaul MPH PhD
> WA Centre for Health & Ageing (M573)
> University of Western Australia
> Level 6, Ainslie House
> 48 Murray St
> Perth 6000
> Phone: (08) 9224-2701
> Fax: (08) 9224 8009
> email: Kieran.McCaul@uwa.edu.au
> http://myprofile.cos.com/mccaul
> http://www.researcherid.com/rid/B-8751-2008
> ______________________________________________
> If you live to be one hundred, you've got it made.
> Very few people die past that age - George Burns
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
mm@pinestreetfoundation.org

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```