Hi,
I think that I got the job done.
In any case, for completeness, this time I am posting the small snippet I
created.
Cheers
Lorenzo
#############################################################
library("ggplot2")
library(tikzDevice)
library(gridExtra)
library(grid)
library(plyr)
set.seed(1234)
## see also
http://bit.ly/14mbLlH
year <- c(rep("2004",runif(1,50,350)),
rep("2005",runif(1,50,350)),
rep("2006",runif(1,50,350)),
rep("2007",runif(1,50,350)),
rep("2008",runif(1,50,350)),
rep("2009",runif(1,50,350)),
rep("2010",runif(1,50,350)),
rep("2011",runif(1,50,350)),
rep("2012",runif(1,50,350))
)
len <- length(year)
len3 <- round(len/3)
location <- c(rep("Old town",len3),
rep("Mid town", len3),
rep("Lower keys", (len-2*len3))
)
location <- sample(location)
mydata <- cbind(as.data.frame(year),
as.data.frame(location))
lbls <- levels(mydata$year)
gpl <- ggplot(mydata, aes(location, fill=year ) ) +
geom_hline(yintercept = seq(0,120,by=20), col="black", size=0.5)+
geom_bar(position=position_dodge(width=0.9,height=0))+
opts( panel.background=theme_rect(fill='white', size=1.5))+
opts(panel.grid.minor = theme_blank())+
opts(panel.grid.major = theme_blank())+
opts(axis.ticks = theme_segment(colour = "black",
size=1),axis.ticks.length = unit(0.15, "cm"))+
scale_fill_manual("Year", breaks=lbls, labels=lbls,
values=c(1,2,3,4,5,6,7,8,"brown"))+
opts(title = expression(paste("Number of Sales")))+
opts(plot.title = theme_text(size = 25))+
scale_y_continuous(limits=c(0,120),breaks=seq(0,120, by=20))+
xlab("")+
ylab("")+
opts(axis.title.x = theme_text(size = 2))+
opts(axis.title.y = theme_text(size = 2, angle=90))+
## opts(axis.text.x = theme_text(size=15, colour="gray",vjust=1))+
## opts(axis.text.y = theme_text(size=15, colour="gray", hjust=1))
opts(axis.text.x = theme_text(size=15, colour="black",vjust=1))+
opts(axis.text.y = theme_text(size=15, colour="black", hjust=1))
tikz('market_visualization_tik.tex', standAlone = TRUE, width=8,height=5)
print(gpl)
dev.off()
tools::texi2dvi('market_visualization_tik.tex',pdf=T)