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]

Re: st: Bar and line graph problem


From   Beatrice Crozza <beatrice.crozza@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Bar and line graph problem
Date   Fri, 28 Feb 2014 15:32:32 +0000

Dear Nick,

thank you very much for your reply.

In my case what I have is that the correct bar graph is the one that
in your example you can have writing:

twoway bar turn rep78


but than when I combine it with my line graph I have something similar
to what you obtain combining the two graph.

How can I overly the line to the bar graph, having the same bar graph
that I obtain when I do not combine the two?

Thanks,
Bea

2014-02-28 15:16 GMT+00:00 Nick Cox <njcoxstata@gmail.com>:
> "the same" means "absolutely identical"?
>
> Here is a sandpit to play in:
>
> . sysuse auto
> (1978 Automobile Data)
>
> . collapse (mean) turn trunk, by(rep78)
>
> . l
>
>      +---------------------------+
>      | rep78      turn     trunk |
>      |---------------------------|
>   1. |     1        41       8.5 |
>   2. |     2    43.375    14.625 |
>   3. |     3   41.0667   15.2667 |
>   4. |     4      38.5      13.5 |
>   5. |     5   35.6364   11.4545 |
>      |---------------------------|
>   6. |     .      37.6      11.4 |
>      +---------------------------+
>
> . twoway bar turn rep78 || line trunk rep78
>
> . twoway bar turn rep78
>
> . twoway bar turn rep78 || line trunk rep78 , ysc(r(0 .))
>
> Please relate your discussion to that, or any other reproducible
> example of your choice.
>
> Nick
> njcoxstata@gmail.com
>
>
> On 28 February 2014 15:04, Beatrice Crozza <beatrice.crozza@gmail.com> wrote:
>> Dear All,
>>
>> I have an issue in overlying (not combining) a bar and a line graph.
>>
>> When I do them separately, everything is fine, however, when I overly
>> the line to the bar, as a result I have that all the bars become the
>> same.
>>
>> What I am doing wrong?
>>
>> This is the code:
>> twoway (bar D dow, yaxis(1) yscale(range(0))) (line amrt1 dow, sort yaxis(2))
>>
>> Thank you very much for your help.
>>
>> Bea
>> *
>> *   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/
> *
> *   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/
*
*   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