On 09/23/2013 01:56 PM, arun wrote:
You could try ggplot() as well.
library(ggplot2)
library(gridExtra)
library(plyr)
x1<- count(x)
y1<- count(y)
p1<-ggplot(x1,aes(x=x,y=freq))+geom_bar(stat="identity",colour="gray",fill="red")+xlim(c(35,85))+
theme_bw()+ theme(axis.line=element_line(colour="black"),
panel.grid.major=element_blank(), panel.grid.minor=element_blank(),
panel.border=element_blank(),panel.background=element_blank())
p2<-ggplot(y1,aes(x=x,y=freq))+geom_bar(stat="identity",colour="gray",fill="blue")+xlim(c(35,85))
+theme_bw()+ theme(axis.line=element_line(colour="black"),
panel.grid.major=element_blank(), panel.grid.minor=element_blank(),
panel.border=element_blank(),panel.background=element_blank())
grid.arrange(p1,p2,nrow=2)
A.K.
Hi arun,
Okay, if we're allowed to use packages, challenge taken:
library(plotrix)
barp(tabulate(x,nbins=85)[35:85],names.arg=35:85)
barp(tabulate(y,nbins=85)[35:85],names.arg=35:85)
Jim
______________________________________________
R-help@r-project.org 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.