Skip to content
Back to formatted view

Raw Message

Message-ID: <49466.128.39.232.27.1236757830.squirrel@webmail.umb.no>
Date: 2009-03-11T07:50:30Z
From: Honorata Kaja Gajda
Subject: Barplot -density and multhist x-axis problem

Thanks in advance for any help

I would like to plot a barplot with probability density instead of count
frequencies, as is possible in histograms (freq=FALSE). Is this possible?
I have tried the following code:

with(center,table(light))->light.table
barplot(light.table ,col=brewer, freq=FALSE, beside=T)

But  freq=FALSE doesn?t seem to work in the command of barplot.
The reason why I want to use a barplot is that I have two variables. I
have tried to use multhist instead, but when I plot the histogram the
x-axis labels are unevenly spaced. I would like to create a bar with 7
ticks on the x-axis (1,2,3..7), however the following tics are yielded in
the x-axis (1, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5). How can I regulate this?
I have used the following code:

l<-list(m1=(center$light[center$site=="1"]),
m2=(center$light[center$site=="2"]))
multhist(l,breaks=c(1:7, by=1), freq=FALSE, main="Illumination in Plot
Center", ylab="Density", col =brewer)

I have tried names.arg= but this doesn?t work in multihist either.
Is there any way around this problem? Either by using barplot or multihist?

I am very grateful for any help
Honorata