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 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]

Re: st: overlay bar and line graphs in STATA


From   Maria Fleischmann <maria.s.fleischmann@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: overlay bar and line graphs in STATA
Date   Wed, 18 May 2011 17:09:00 +0200

Hi Siddhi,

Assuming your variables are called the following:
flu: # of flu positive cases
cal: calender
swabs: percent of swabs which are flu positive

you could try:
graph twoway (bar flu cal, yaxis(1)) (line swabs cal, yaxis(2))

Does this help?
Maria

On 18 May 2011 16:44,  <sidbela@vsnl.com> wrote:
> Hi
> I am using STATA 11.
>
> Wonder if you can help me out on the following:
>
> I have 2 graphs,
> 1) bar graph: y axis: # of flu positive cases; x-axis: calendar period
> 2) line graph: y axis: percent of swabs which are flu positive; x-axis: calendar period
>
> the x-axis is common to both graphs.
> I now want to create a single graph (bar graph overlay on line graph) with y1 ( # of flu positive cases) and y2 axis (percent of swabs which are flu positive) and x-axis as common.
>
> In stata, can I overlay (not combine side by side) a bar graph on a line graph in the same graph?
>
> The "graph combine" option combines graphs but does not overlay them. The "addplot" option works only if both the graphs to be combined are twoway line graphs.
>
> hope you can help me on this.
>
> regards
> siddhi
>
> *
> *   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/
>

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index