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: Labeling Vertical Lines


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Labeling Vertical Lines
Date   Wed, 5 Dec 2012 07:52:00 +0000

I'd think about using two x axes:

sysuse auto

histogram mpg

histogram mpg, start(10) width(5) xaxis(1 2) xli(15 25 35)
         xla(15 "guzzler"  25 "mediocre"  35 "economic", axis(2))
xtitle("", axis(2)) xla(10(5)40, axis(1)) freq

Nick

On Wed, Dec 5, 2012 at 12:33 AM, Sharooon <treeshar@yahoo.com> wrote:

> I am making a histogram using data that ranges from 0-200 where I have four vertical lines that are important to my data:
>
> histogram totalpoints, discrete percent xline(50 75 100 125)
>
>
> I'd like to label them, but when I run the code
>
> histogram totalpoints, discrete percent xline(50 75 100 125) xlabel(50 "2 Stars" 75 "3 Stars" 100 "4 Stars" 125 "5 Stars")
>
>
> It replaces the tick marks with my "2 Stars" etc.. I can tell it to put some of the tick marks back on by writing xlabel( 25 50 "2 Stars"), but that also looks strange.
>
> What I'd really like is for the numerical x labels to be there (stata default is fine) but with these additional vertical lines being labeled somewhere, there is space on the graph but I can't figure out how to do it.
*
*   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/


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