Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: box and whisker plot with proportional box size?

From   Jeph Herrin <>
Subject   Re: st: RE: box and whisker plot with proportional box size?
Date   Thu, 02 Sep 2010 10:48:02 -0400

Nick - thanks, I'll give it a look.

In response to Ronan, yes, it may not always be the best figure,
but sometimes it is. Perhaps more to the point, this week such figures
appears in both Lancet and New England Journal of Medicine, journals
that influence my colleagues a good bit, and hence me (to a lesser


On 9/2/2010 10:07 AM, Nick Cox wrote:
Yes!; but you may not like the answer:

. sysuse auto
(1978 Automobile Data)

. graph7 mpg, box by(foreign) vw

How to do this is discussed within

SJ-9-3  gr0039  . . . . . . . . Speaking Stata: Creating and varying box plots
         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
         Q3/09   SJ 9(3):478--496                                 (no commands)
         explains how to use egen to calculate the statistical
         ingredients needed for box plots and variations of box
         plots; shows the use of twoway to then create the plots

but there is no easy solution that I know. You would have to superimpose several -twoway-s to get there.


Jeph Herrin

A colleague has shown me a couple of box and whisker plots where
the width of the box (that is, the dimension that is perpindicular
to the whiskers) is proportionate to the number of observations the
box represents. I think it's a useful modification, and have been
trying to create this myself. However there seems to be no option
in -graph box- to control the width of the box.

Is there a graph type and option combination that I am overlooking
that will allow me to create box and whisker type plots while
controlling the widths of the individual boxes?

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index