Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: xline() on top of histogram


From   Alan Neustadtl <alan.neustadtl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: xline() on top of histogram
Date   Sat, 14 Apr 2012 13:48:29 -0400

One way is to use -graph twoway- and draw the histogram first and then
overlay a line.  The following does that with a vertical line at the
mean of the graphed variable:

sysuse auto, clear
graph twoway (hist mpg) (scatteri 0 21.3 .1 21.3, c(l) m(i))

Best,
Alan



On Sat, Apr 14, 2012 at 1:40 PM, Jorge Alé Chilet
<jorge.ale@mail.huji.ac.il> wrote:
> Hi, everybody,
> I want to draw a vertical line above a histogram. The command xline() draws a line that appears under the histogram bars. Do you have any sugestion?
> Thanks,
> Jorge
>
> *
> *   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/

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index