Skip to content

Barchart to make a graph like this??

4 messages · knussear, Carlos Ortega, Deepayan Sarkar +1 more

#
Hi list,

I'm trying to get R to make a graph like the one shown in this pdf, where
males are white bars and females are black bars.

http://www.brrc.unr.edu/~knussear/mmgraph.pdf

I tried barchart, but I couldnt get the bars to share a common x axis.

Do you have any suggestions?

Thanks for your help

Ken
#
Hello,

Please check the search engines available in the Mailing Lists and look
for "bar", there is a similar post dated February 2002 titled:
"Smoothed lines over barplots"

Hope it helps,
Carlos Ortega.


-----Mensaje original-----
De: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] En nombre de
knussear at biodiversity.unr.edu
Enviado el: martes, 13 de mayo de 2003 10:01
Para: r-help at stat.math.ethz.ch
Asunto: [R] Barchart to make a graph like this??


Hi list,

I'm trying to get R to make a graph like the one shown in this pdf,
where males are white bars and females are black bars.

http://www.brrc.unr.edu/~knussear/mmgraph.pdf

I tried barchart, but I couldnt get the bars to share a common x axis.

Do you have any suggestions?

Thanks for your help

Ken

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

###  This email has been checked for all known viruses by the 
###  Firstnet anti-virus system - http://www.firstnet.net.uk 
###  Please email fav at firstnet.net.uk for details. 


_____
The information in this email is confidential and it may not be\... {{dropped}}
#
On Tuesday 13 May 2003 03:00, knussear at biodiversity.unr.edu wrote:
I'm assuming by this you mean barchart in the lattice package.
Some information on the form of your data would have helped.

This is not the standard form of a barchart, so you need to fudge some things. 
First of all, make the values in one of the groups (the ones you want on the 
left) negative. Then barchart with groups (or use + in the formula, depending 
on the form of your data), stack=TRUE should give you what you want. Of 
course, the axis labels will be negative, you need to control those using 
scales.

HTH,

Deepayan
#
Ken, I actually asked about doing this on the list sometime ago
and received a number of very useful suggestions. If you search
the archives for "Christmas tree graphs" you'll discover all you
need to know (and more).

Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww at cheque.uq.edu.au


Quoting Deepayan Sarkar <deepayan at stat.wisc.edu>: