On Jan 25, 2008 2:04 PM, Domenico Vistocco <[EMAIL PROTECTED]> wrote:
> You could use ggplot2:
>
> library(ggplot2)
> x=rnorm(100)
> y=rnorm(100)
> df=melt(data.frame(x,y))
> #for "vertical" histogram
> ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable)
> #for "horizontal" histogr
You could use ggplot2:
library(ggplot2)
x=rnorm(100)
y=rnorm(100)
df=melt(data.frame(x,y))
#for "vertical" histogram
ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable)
#for "horizontal" histogram
ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) +
coord_flip
You might look at the method histbackback (back-to-back histograms) in
package Hmisc. At the time I looked at this package about a year ago,
I could not get it working on my Mac, so I don't actually know what
the results look like, but I have created them before in XLispStat and
found them
Juan Pablo Fededa wrote:
> Dear Contributors:
>
> I have two vectors x and z, and I want to display the histograms of both
> vectors in the same graph, x in red bars, z in blue bars.
> If you have any clue on how to do that, I will be very glad to hear it!!
> Thanks in advance again,
>
Hi Jua
Duncan Murdoch wrote:
> On 1/24/2008 9:43 AM, Juan Pablo Fededa wrote:
>
>> Dear Contributors:
>>
>> I have two vectors x and z, and I want to display the histograms of both
>> vectors in the same graph, x in red bars, z in blue bars.
>> If you have any clue on how to do that, I will be very gla
On 1/24/2008 9:43 AM, Juan Pablo Fededa wrote:
> Dear Contributors:
>
> I have two vectors x and z, and I want to display the histograms of both
> vectors in the same graph, x in red bars, z in blue bars.
> If you have any clue on how to do that, I will be very glad to hear it!!
It's hard to
That's an easy one with ggplot2.
library(ggplot2)
dataset <- data.frame(variable = gl(2, 50, labels = c("x", "z")), value
= c(runif(50), rnorm(50)))
ggplot(data = dataset, aes(x = value, fill = variable)) +
geom_histogram(position = "dodge") + scale_fill_manual(values = c("red",
"blue"), guide = "
7 matches
Mail list logo