Bookmark and Share

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


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

RE: st: RE: Line break in a character string for a bar chart label


From   "Radwin, David" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Line break in a character string for a bar chart label
Date   Tue, 30 Jul 2013 18:04:24 -0400

Here is another alternative that doesn't require relabeling the dataset
but could lead to some quite prolix code:

. graph hbar (mean) price, over(foreign, relabel(0  ///
	`" "A really long label that has to" "split over onto the next
line" "'))

David
--
David Radwin
Senior Research Associate
Education Studies Division
RTI International
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Data Analytics Corp.
> Sent: Tuesday, July 30, 2013 2:02 PM
> To: [email protected]
> Subject: Re: st: RE: Line break in a character string for a bar chart
> label
> 
> Hi,
> 
> Not sure about this since the label is in a variable in the data set
(I
> forgot to mention that).  But I can always change the data set.  I'll
> try it.
> 
> Thanks,
> 
> Walt
> 
> ________________________
> 
> Walter R. Paczkowski, Ph.D.
> Data Analytics Corp.
> 44 Hamilton Lane
> Plainsboro, NJ 08536
> ________________________
> (V) 609-936-8999
> (F) 609-936-3733
> [email protected]
> www.dataanalyticscorp.com
> _____________________________________________________
> 
> 
> On 7/30/2013 4:52 PM, Radwin, David wrote:
> > Walt,
> >
> > Like this?
> >
> > . sysuse auto
> >
> > . label define origin 0 ///
> > 	`" "A really long label that has to" "split over onto the next
> > line" "', modify
> >
> > . graph hbar price, over(foreign)
> >
> > David
> > --
> > David Radwin
> > Senior Research Associate
> > Education Studies Division
> > RTI International
> > 2150 Shattuck Ave., Suite 800
> > Berkeley, CA 94704
> > Phone: 510-665-8274
> >
> > www.rti.org
> >
> >
> >> -----Original Message-----
> >> From: [email protected] [mailto:owner-
> >> [email protected]] On Behalf Of Data Analytics Corp.
> >> Sent: Tuesday, July 30, 2013 1:36 PM
> >> To: [email protected]
> >> Subject: st: Line break in a character string for a bar chart label
> >>
> >> Hi,
> >>
> >> I created a horizontal bar chart of magazine readership.  The
labels
> > for
> >> each bar are combinations of the magazines. Unfortunately, some
labels
> >> are too long (too many magazines for a bar) and are cut-off or they
> > just
> >> don't look nice.  I'd like to insert a line break in the character
> >> strings so that the labels would appear on two (or more) lines.
Some
> >> programming languages, such as R, use "\n" to break a line.  Does
> > Stata
> >> (13 for Windows) have something like this?  Or is there a way to
tell
> >> Stata to wrap a line?
> >>
> >> Thanks,
> >>
> >> Walt
> >>
> >> ________________________
> >>
> >> Walter R. Paczkowski, Ph.D.
> >> Data Analytics Corp.
> >> 44 Hamilton Lane
> >> Plainsboro, NJ 08536
> >> ________________________
> >> (V) 609-936-8999
> >> (F) 609-936-3733
> >> [email protected]
> >> www.dataanalyticscorp.com
> >> _____________________________________________________

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index