Hi guys, I'm new to R and this might be a basic question. I want to have a plot with a table right under it containing all the data in the plot. Is that possible in R? How do to it? Thanks! Yuhan -- View this message in context: http://www.nabble.com/plotting-with-a-table-right-under-it-tp19705866p19705866.html Sent from the R help mailing list archive at Nabble.com.
R is Not Excel, I think... But if you insist on "drawing" a table below the graph, you may use rect() and text(). Why not add your numbers directly to your bars/lines/points/...? If you can express the information in a table, why use a plot? Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Sun, Sep 28, 2008 at 3:45 AM, david8373 <david8373 at gmail.com> wrote:> > Hi guys, > > I'm new to R and this might be a basic question. I want to have a plot with > a table right under it containing all the data in the plot. Is that possible > in R? How do to it? > > Thanks! > > Yuhan > -- > View this message in context: http://www.nabble.com/plotting-with-a-table-right-under-it-tp19705866p19705866.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >
david8373 wrote:> Hi guys, > > I'm new to R and this might be a basic question. I want to have a plot with > a table right under it containing all the data in the plot. Is that possible > in R? How do to it? > >Hi Yuhan, Try this: library(plotrix) par(mfrow=c(2,1)) x<-rnorm(10) y<-rnorm(10) plot(x,y) plot(0,xlim=c(-1,1),ylim=c(-1,1),type="n", axes=FALSE,xlab="",ylab="") addtable2plot(-1,0.3,matrix(round(c(x,y),2), nrow=2,byrow=TRUE), display.colnames=FALSE) Jim