Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: formatting bar chart legend and bar values


From   "Scott Merryman" <[email protected]>
To   [email protected]
Subject   Re: st: formatting bar chart legend and bar values
Date   Wed, 12 Mar 2008 20:40:27 -0500

On Wed, Mar 12, 2008 at 2:03 PM, Jeff Simonson <[email protected]> wrote:
> Hello,
>
> I am having trouble with two items:
>
> First, I can't seem to get the legend of a bar chart to display the
> variable label. It only wants to display 'mean of wq4a', 'mean of wq4b',
> etc.
>
>> Second, the blabel displays the full value of the mean. How do I truncate
> it to #.# format?

You can use -legend(order(...)) to rename the legend text.  I no
longer have 9 installed, but at least in version 10, there is a format
option for -blabel-.

For example:
sysuse auto

graph bar (mean) mpg gear trunk,  ///
 over(fore) blabel(bar, format(%9.1f)) legend(order(1 "Mileage" 2
"Gear Ratio" 3 "Trunk Space"))

Scott
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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