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

From |
"Scott Merryman" <scott.merryman@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: programming graphs in stata |

Date |
Tue, 16 Oct 2007 18:36:26 -0500 |

On 10/16/07, Schonlau, Matthias <matt@rand.org> wrote: > For programming new graphs in stata, Stata 7 offered the command "gph". > This is still available under version control, but I believe the use of > gph at this point is discouraged. (Right?) > > I am particularly interested in creating spine plots. These are plots > similar to barcharts, but with the width proportional to frequency (and > constant height). Barcharts work just the other way around. Do you mean something like this? sysuse auto,clear graph bar (count) mpg, over(rep) name(gr1,replace) collapse (count) mpg, by(rep) keep if rep !=. sum mpg gen freq = mpg/r(sum) gen f2 = fre expand 2 bysort rep: gen t = _n replace f2 = 0 if t == 1 gen sum = sum(fre) if t ==1 gen foo = 1 twoway area foo sum if rep <=1, color(gs12) /// || area freq sum if rep <=1 /// || area foo sum if rep <=2 & rep>1 , color(gs12) /// || area freq sum if rep <=2 & rep>1 /// || area foo sum if rep <=3 & rep>2 , color(gs12) /// || area freq sum if rep <=3 & rep>2 /// || area foo sum if rep <=4 & rep>3 , color(gs12) /// || area freq sum if rep <=4 & rep>3 /// || area foo sum if rep <=5 & rep>4 , color(gs12) /// || area freq sum if rep <=5 & rep>4 /// ||, legend(off) xlabel(none) xtitle("") yscale(off) 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/

**Follow-Ups**:**Re: st: programming graphs in stata***From:*Maarten buis <maartenbuis@yahoo.co.uk>

**References**:**st: programming graphs in stata***From:*"Schonlau, Matthias" <matt@rand.org>

- Prev by Date:
**st: Integrating Graphs and Output into single file** - Next by Date:
**Re: st: FORTRAN 77's GO TO <label> CONTINUE into Mata** - Previous by thread:
**st: programming graphs in stata** - Next by thread:
**Re: st: programming graphs in stata** - Index(es):

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