[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
Ulrich Kohler <[email protected]> |

To |
[email protected] |

Subject |
Re: st: Combined Horizontal Box Blots do not line up |

Date |
Fri, 16 Sep 2005 12:31:07 +0200 |

Thanks Vince, this answered my question thouroughly. I went for the -reshape- solution, which is far as complicated as I thought. To round this tread up, here is a template for the auto-data: . gen cov1:cov = rep78 . gen cov2:cov = 6 + foreign . label define cov 6 "Domestic" 7 "Foreign" . reshape long cov, i(make) j(dim) . graph box turn, over(cov) by(dim, cols(1)) nofill horizontal Reshape rules! Uli Vince Wiggins, StataCorp wrote: > Ulrich Kohler <[email protected]> asks why the option -xcommon- is not > doing what he expects, > > > I try to combine horizontal box blots underneath each other by using > > the -xcommon- option, but they do not line up. > > > > Here is an example for what I try to do: > > > > . sysuse auto, clear > > . graph box turn, over(rep78) name(g1, replace) horizontal > > . graph box turn, over(foreign) name(g2, replace) horizontal > > . graph combine g1 g2, xcommon cols(1) > > > > . graph combine g1 g2, ycommon cols(1) > > > > which doesn't work [...] > > I ran Uli's example see that both graphs are already on a common X scale -- > they both run from 30 to 50 with 5 ticks on the axis. -xcommon- would make > these axes common for Uli, if they were indeed different in the original > graphs. > > I think what Uli is asking is why aren't the plot regions forced to be the > same length in the combined graphs. (They are not in the original graphs > because the labels on the y-axis are of vastly different lengths.) That > would be a laudable goal, but it is not what -xcommon- means and not what > -graph combine- does. > > -graph combine- combines whole graphs. It can squish the overall > dimensions of the graphs so that they take up the entire size of the > combined graph's dimensions, but it cannot reach into the two graphs and > rip out pieces to create a Franken-graph (with apologies to Mary Shelley). > > It is not elegant, but Uli can get the plotregions to align by seeing to it > that the original graphs have the same length plotregion. Adding a left > margin to the first graph, using something like -graphregion(margin(l=15))- > will do the trick. Uli will have to fidget with the size of the margin. > > Uli goes on to suggest, > > > I can imagine a solution with reshaping the data and applying the > > -by()- option instead of the -graph combine- solution, but do you > > know an easier one? > > And, that will work too. > > > -- Vince > [email protected] > > * > * For searches and help try: > * http://www.stata.com/support/faqs/res/findit.html > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ -- [email protected] +49 (030) 25491-361 * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**Re: st: Combined Horizontal Box Blots do not line up***From:*[email protected] (Vince Wiggins, StataCorp)

- Prev by Date:
**st: recoding strings** - Next by Date:
**Re: st: recoding strings** - Previous by thread:
**Re: st: Combined Horizontal Box Blots do not line up** - Next by thread:
**Re: Re: st: Combined Horizontal Box Blots do not line up** - Index(es):

© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |