Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Bar graph


From   Friedrich Huebler <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Bar graph
Date   Tue, 4 Jun 2013 11:00:46 -0400

Jörg,

You can start with the examples on the Stata website.

http://www.stata.com/support/faqs/graphics/gph/graphdocs/horizontal-overlaid-twoway-bar-plots/index.html
http://www.stata.com/support/faqs/graphics/gph/graphdocs/horizontal-bar-chart-with-multiple-bars-graphed-over-another-variable/

Let's modify the second graph to draw the data like in the first graph.

. webuse citytemp
. replace tempjan = -1 * tempjan
. collapse tempjan tempjuly, by(region)
. twoway bar tempjan region, horizontal || bar tempjuly region,
horizontal ylabel(1 "NE" 2 "N Cntrl" 3 "South" 4 "West", angle(0))
ytitle("") xlabel(-50 "50" 0 "" 50 "50")

Friedrich

On Tue, Jun 4, 2013 at 10:43 AM, Nick Cox <njcoxstata@gmail.com> wrote:
> I wrote a program -slideplot- (SSC) a while back.
>
> I am no longer fond of this approach, so have not really developed it
> since.  But the program is still lurking there, heedless of my lack of
> affection.
>
> An overarching comment is that if -graph hbar- gets awkward, you
> should switch to -twoway rbar-.
> Nick
> njcoxstata@gmail.com
>
>
> On 4 June 2013 15:19, Jörg Eulenberger <j.eulenberger@web.de> wrote:
>>
>> Dear Statalisters,
>> i want to draw a graph like a Agepyramid to compare two groups, like this:
>> http://www.martensville.ca/images/pages/N211/age%20pyramid.jpg
>>
>>  But i don't want on the left side the Agegroups. I need on the left
>> side different Items.  Each row should show the values of one item, on
>> the one side the value of man and on the otherside the value for woman.
>>
>> The Graph i want is on page 23:
>> http://wcms.uzi.uni-halle.de/download.php?down=13415&elem=2248245
>>
>> Know every one a solution or a graph command?
>> Thanks a lot,
>> Jörg

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index