Bookmark and Share

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


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

st: formatting bar graph by(groups)


From   "B. Timothy Walsh" <[email protected]>
To   [email protected]
Subject   st: formatting bar graph by(groups)
Date   Wed, 13 Nov 2013 10:11:39 -0500

I am attempting to build a graphical summary of 4 studies using bar graphs in Stata12. Two studies need 3 bars and 2 need 2 bars (corresponding to different numbers of Treatment cells in the various studies). I am very close to having what I want but have a minor annoying problem.

The command I am using includes the following elements, plus some formatting directions:

graph bar (asis) Baseline Change, stack over(Treatment) nofill ///
	by(study, cols(3) holes(4 6) title("Title")

The first 3 graphs—2 with 3 bars and 1 with 2—are fine. Each plot area is of the same width and the bars in the 2-bar graph are wider so they are nicely centered in the plot region. The problem is with the 4th graph: the 2 bars are of the same width as in the 3-bar graphs, so they are over to the left and there's a space on the right side where a third bar would go, even though there is no third Treatment in that study.

I would like the bars in the 4th graph to be centered within the plot region, and of the same width as the other 2-treatment graph.

I hope this description is clear. Happy to supply any additional information. Thanks in advance!

Tim



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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