I created several graphs (total of 6) using survival methods:
here is my sample code:
stset "time to event", id(usubjid) failure(event==1) scale(30) exit (time 1800)
sts graph, failure by(subgrouptreat) ytitle("Cumulative Incidence (%)", size(small)) ylabel(0 "0" 0.05 "5" 0.10 "10" 0.15 "15" 0.20 "20") xtitle("months") title ("title of the graph") legend(on order(1 "subgroup1 pla" 2 "subgroup1 tx" 3 "subgroup2 plac" 4 "subgroup2 tx" 5 "subgroup3 plac" 6 "subgroup3 tx"))legend(position(1) size(tiny) rows(1))
graph save graph1.gph, replace
I do this for 6 graphs
then combine them using:
graph combine graph1.gph graph2.gph graph3.gph graph4.gph graph5.gph graph6.gph,
graph export combined_graphtreat.png, as(png) width(3000) height(2000) replace
however, I encounter a problem after combining all the graphs, the Ytitle - cumulative incidence is superimposed into the Yaxis labels (see attached .png)
is there any work around for this, I have tried margins and iscale which did not work
thank you!
here is my sample code:
stset "time to event", id(usubjid) failure(event==1) scale(30) exit (time 1800)
sts graph, failure by(subgrouptreat) ytitle("Cumulative Incidence (%)", size(small)) ylabel(0 "0" 0.05 "5" 0.10 "10" 0.15 "15" 0.20 "20") xtitle("months") title ("title of the graph") legend(on order(1 "subgroup1 pla" 2 "subgroup1 tx" 3 "subgroup2 plac" 4 "subgroup2 tx" 5 "subgroup3 plac" 6 "subgroup3 tx"))legend(position(1) size(tiny) rows(1))
graph save graph1.gph, replace
I do this for 6 graphs
then combine them using:
graph combine graph1.gph graph2.gph graph3.gph graph4.gph graph5.gph graph6.gph,
graph export combined_graphtreat.png, as(png) width(3000) height(2000) replace
however, I encounter a problem after combining all the graphs, the Ytitle - cumulative incidence is superimposed into the Yaxis labels (see attached .png)
is there any work around for this, I have tried margins and iscale which did not work
thank you!
Comment