[R] Need help with barplots

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[R] Need help with barplots

laba diena
I`ve read all the manuals and still couln`t find what is the difference
between the stacked and side-by-side barplots ? Could you explain me ?

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: [R] Need help with barplots

Peter Dalgaard
"laba diena" <[hidden email]> writes:

> I`ve read all the manuals and still couln`t find what is the difference
> between the stacked and side-by-side barplots ? Could you explain me ?

Did you try

par(ask=TRUE)
example(barplot)  

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: [R] Need help with barplots

David Barron-2
In reply to this post by laba diena
First, produce two barplots for comparison:

> par(mfrow=c(2,1) )
> barplot(VADeaths,beside=TRUE)
> barplot(VADeaths)

The same information is in both plots; in the top, it is displayed as
5 separate bars for each group, and in the stacked plot it is shown as
5 separate regions in each of the four bars.  The hight of each of
these regions is the same as the hight of the corresponding bar in the
side-by-side plot.  The stacked plot enables you to see overall
differences more easily (easier to see that the death rate is highest
for Urban Males), but it is harder to compare the sizes of the
categories.

On 13/10/06, laba diena <[hidden email]> wrote:

> I`ve read all the manuals and still couln`t find what is the difference
> between the stacked and side-by-side barplots ? Could you explain me ?
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


--
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: [R] Need help with barplots

Henric Nilsson
On 2006-10-13 10:55, David Barron wrote:

> First, produce two barplots for comparison:
>
>> par(mfrow=c(2,1) )
>> barplot(VADeaths,beside=TRUE)
>> barplot(VADeaths)
>
> The same information is in both plots; in the top, it is displayed as
> 5 separate bars for each group, and in the stacked plot it is shown as
> 5 separate regions in each of the four bars.  The hight of each of
> these regions is the same as the hight of the corresponding bar in the
> side-by-side plot.  The stacked plot enables you to see overall
> differences more easily (easier to see that the death rate is highest
> for Urban Males), but it is harder to compare the sizes of the
> categories.

Take a look at ?spineplot.


HTH,
Henric



>
> On 13/10/06, laba diena <[hidden email]> wrote:
>> I`ve read all the manuals and still couln`t find what is the difference
>> between the stacked and side-by-side barplots ? Could you explain me ?
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.