Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Devra Golbe <dgolbe@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: "overlaying" Stacked bar charts |

Date |
Thu, 18 Feb 2010 22:15:08 -0500 |

Devra ************************** webuse citytemp, clear collapse (mean) heat cool tempja tempju, by(region) expandcl 2, cluster(region) gener(reg2) forvalues n = 1(2)7 { replace tempjan=. if reg2==`n' replace tempjuly=. if reg2==`n'

replace heatdd=. if reg2==`n' replace cooldd=. if reg2==`n'

on 2/17/2010 2:06 PM Nick Cox said:

-graph bar- does not permit overlay. That is a -twoway- concept. Thatyou know.If you attempted to translate -graph bar- into an equivalent -twoway- statement, you would need to do more work. For example, stacking bars calls for -twoway rbar- rather than -twoway bar- and you still need to do more work to specify the cumulated coordinates. And -twoway bar- doesnot permit -over()-, as indicated.I'd imagine you're better off staying with -graph bar-. But if I understand you correctly you'd need to -reshape- or -stack- your data so that you could then call -graph bar- with two separate -over()- options.Nickn.j.cox@durham.ac.ukDevra GolbeIs there a way to "overlay" stacked bar charts? That is, using thecitytemp data I can gowebuse citytemp graph bar tempjan tempjuly, over(region) stack graph bar heatdd cooldd, over(region) stackand get two separate graphs each over region. What I would like is onegraph, with the temp bar for each region paired with the correspondingdegree-day bar. I guessed the code would be something like thefollowing pseudo-code, which results in an error:twoway (bar tempjan tempjuly ) (bar heatdd cooldd ), over(region) stack option over() not allowed r(198);

* * 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/

**References**:**st: "overlaying" Stacked bar charts***From:*Devra Golbe <dgolbe@gmail.com>

**st: RE: "overlaying" Stacked bar charts***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: Why does streg allow both state fixed-effects and time invariant state variables?** - Next by Date:
**Re: st: net awareness and security** - Previous by thread:
**st: RE: "overlaying" Stacked bar charts** - Next by thread:
**st: problem with xtcsd** - Index(es):