Bookmark and Share

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

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

st: RE: "overlaying" Stacked bar charts

From   "Nick Cox" <>
To   <>
Subject   st: RE: "overlaying" Stacked bar charts
Date   Wed, 17 Feb 2010 19:06:08 -0000

-graph bar- does not permit overlay. That is a -twoway- concept. That
you 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- does
not 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.


Devra Golbe

Is there a way to "overlay" stacked bar charts?  That is, using the 
citytemp data I can go

webuse citytemp
graph bar tempjan tempjuly, over(region) stack
graph bar  heatdd cooldd, over(region) stack

and get two separate graphs each over region.  What I would like is one 
graph, with the temp bar for each region paired with the corresponding 
degree-day bar.   I guessed the code would be something like the 
following pseudo-code, which results in an error:

twoway (bar tempjan tempjuly ) (bar  heatdd cooldd ), over(region) stack
option over() not allowed

I've checked Mitchell's "Visual Guide to Stata Graphics", as well as the

web and the Statalist, and found no clues.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index