Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Seed, Paul" <paul.seed@kcl.ac.uk> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | RE: Re: st: Combining graphs as is without resizing. |
Date | Wed, 24 Jul 2013 09:09:33 +0000 |
Many thanks once again Vince. That worked very well. I can play with -iscale()- to get the relative size of the components as I want. Best wishes, Paul T Seed, Senior Lecturer in Medical Statistics, Division of Women's Health, King's College London Women's Health Academic Centre, King's Health Partners (+44) (0) 20 7188 3642. > Date: Tue, 23 Jul 2013 16:25:27 -0500 > From: vwiggins@stata.com (Vince Wiggins, StataCorp) > Subject: Re: st: Combining graphs as is without resizing. > > Paul <paul.seed@kcl.ac.uk> writes that my solution for combining two > graphs "asis" without resizing did not work. > > He's right again, it doesn't work, and it particularly doesn't work > when you have legends and are specifying aspect(1), as Paul is. I > wasn't careful enough with my first "solution". > > Here s a modified suggestion, > > . graph combine a b, cols(1) iscale(.7273) ysize(8) > graphregion(margin(zero)) > > Where: > > -- a and b are the names of the original graphs > > -- cols(1) requests a single column for the two subgraphs > > -- iscale(.7273) specifies a rescaling of the fonts on the > combined graph > > -- ysize(8) specifies that the graph be 8 inches > high -- twice the height of a default Stata > graph. > Paul should substitute twice his original graph > heights for "8" > > -- graphregion(margin(zero)) removes the extra margins around the > combined graph. > > What is ".7273"?? > > Assuming your final graph will be taller than it is wide and that your > original graphs were wider than the were tall, > > iscale = ysize / xsize = 4 / 5.5 ~= .7273 > > Where ysize is the height of the original graph and xsize is the width > of the combined graph. > > Paul should substitute the dimensions from his graphs. > > Why "ysize / xsize"? (Warning technical explanation coming.) The size > of text, markers, and other graph elements are determined relative to > the smaller dimension of the graph -- in this case the ysize. So, a > textsize of "medium" maps to 3.8194 which implies that the text height > is 3.82% of the smaller of xsize and ysize. > > This method of determining relative sizes works pretty well in a most > situations. It works so well that we rarely get questions like Paul's. > That said, I too sometimes want the kind of exact control that Paul is > asking for. > > The sizes of all elements on our original graphs are derived relative > to the ysize of the graph (the smaller of the two dimensions). The > sizes of the same elements on our combined graph are derived relative > to xsize of that graph (the smaller of the two dimensions for the > combined graph). If we want the sizes on the combined graph to match > those of the original graph we will need to scale those sizes by the > ratio of dimensions used to scale the sizes on the two graphs -- the > ysize of our original graph (4) and the xsize of our combined graph > (5.5). > > There is still a very small differences because we have only partially > adjusted for the margins on the combined graph. It is all-but > undetectable on the graphs I have been drawing to test the suggestion > above. > > > - -- Vince > vwiggins@stata.com > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ > > ------------------------------ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/