Statalist


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

Re: AW: st: wrapping axis labels in -graph hbar-


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: AW: st: wrapping axis labels in -graph hbar-
Date   Wed, 20 Jan 2010 09:30:09 -0600

Nick Winter and Ben Jann's -splitvallabels- may also be of use.

Scott

On Wed, Jan 20, 2010 at 8:33 AM, Jeph Herrin <[email protected]> wrote:
>
>
> Something like this works (since I know my labels are <40 chars):
>
>  local relabels ""
>  levelsof group, local(groups)
>  foreach g in `groups' {
>        local label : label group `g'
>        local len : length label
>        if `len'>20 {
>                local p1 : piece 1 20 "`label'", nobreak
>                local p2 : piece 2 20 "`label'", nobreak
>                local relabels "`relabels' `g' `""`p1'" "`p2'"'" '"
>        }
>  }
>  ...
>  graph hbar var1 var2, over(group, relabel(`relabel'))
>

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index