\begin{Schunk}
\begin{Sinput}
 par(mar=c(7.1, 4.1, 2, 2.1))
 par(xpd=T) ##write outside plot region
 bp1 <- barplot(t1,beside=T, las=2, ylim=c(0,1))
 abline(h=seq(0.1, 0.9, by=0.10), lty=3,  lwd=0.2)
 legend("top", legend=c("J.Kerry","G.W.Bush"), fill=gray.colors(2),bg="white")
 bp1
\end{Sinput}
\begin{Soutput}
     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]  1.5  4.5  7.5 10.5 13.5 16.5 19.5
[2,]  2.5  5.5  8.5 11.5 14.5 17.5 20.5
\end{Soutput}
\begin{Sinput}
 text(bp1,t1,label=round(t1,2), pos=1,cex=0.7,col=rbind(rep("white",7),rep("black",7)))
 
\end{Sinput}
\end{Schunk}
