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

From |
"Michael Blasnik" <michael.blasnik@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: RE: labels on bar graphs |

Date |
Tue, 1 Jul 2008 11:03:39 -0400 |

I have written a brief ado to address this problem with graphs. It isn't fully automated in terms of selecting the specific numbers, but a wrapper to select "nice" numbers for the labeled ticks could be used. It's short enough that I can just list it: program define labpct version 9.2 args start step end decimals loc forvalues i=`start'(`step')`end' { local pct: di %5.`decimals'f `i'*100 local pct = trim("`pct'") local pctlist `"`pctlist' `i' "`pct'%" "' } c_local `loc' `"`pctlist'"' end The typical syntax is something like labpct 0 .02 .1 0 ylab The arguments are starting value, step value, max value, number of digits after decimal in the percentage, and name of local macro to contain the result. This command would result in a local macro called ylab that looks like this: di `"`ylab'"' 0 "0%" .02 "2%" .04 "4%" .06 "6%" .08 "8%" .1 "10%" A subsequent graph command could then be : graph ...., ylab(`ylab') Michael Blasnik michael.blasnik@gmail.com On Tue, Jul 1, 2008 at 10:24 AM, Richard Goldstein <richgold@ix.netcom.com> wrote: > I agree that Nick's suggestion would solve my, and other people's, problem > completely > > I also did not understand Frank's comment > > Rich * * 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/

**Follow-Ups**:**RE: st: RE: RE: labels on bar graphs***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**Re: st: RE: RE: labels on bar graphs***From:*Richard Goldstein <richgold@ix.netcom.com>

**RE: st: RE: RE: labels on bar graphs***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: RE: RE: labels on bar graphs***From:*Richard Goldstein <richgold@ix.netcom.com>

- Prev by Date:
**Re: AW: st: table of deviance after multiple regression!** - Next by Date:
**st: RE: problem in uploading data into Stata - data "changes"** - Previous by thread:
**Re: st: RE: RE: labels on bar graphs** - Next by thread:
**RE: st: RE: RE: labels on bar graphs** - Index(es):

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