I wish to create a table in which the foreground is a number (abundance) but the background is a visual representation of a ratio (shallow:deep). In other words, the background of each cell of the table would be two colours or patterns set in a similar fashion to a stacked bar in a bar graph based on a secondary parameter/vector. The table will be extensive (15 by 30) and so I don't want to have to enter the values for each cell manually, but rather refer to a variable. I have seen how to create single color backgrounds, and backgrounds of a color that represents a category, but not a ratio. Possible? -- View this message in context: http://r.789695.n4.nabble.com/How-to-make-the-cell-background-of-a-table-informative-tp4651745.html Sent from the R help mailing list archive at Nabble.com.
Uwe Ligges
2012-Dec-03 10:44 UTC
[R] How to make the cell background of a table informative?
On 03.12.2012 04:41, dweeb wrote:> I wish to create a table in which the foreground is a number (abundance) but > the background is a visual representation of a ratio (shallow:deep). In > other words, the background of each cell of the table would be two colours > or patterns set in a similar fashion to a stacked bar in a bar graph based > on a secondary parameter/vector. > > The table will be extensive (15 by 30) and so I don't want to have to enter > the values for each cell manually, but rather refer to a variable. I have > seen how to create single color backgrounds, and backgrounds of a color that > represents a category, but not a ratio. > > Possible?You can draw, e.g. two filled polygons of appropriate sizes in the background before adding the foreground. Uwe Ligges> > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-to-make-the-cell-background-of-a-table-informative-tp4651745.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. >
Jim Lemon
2012-Dec-03 10:44 UTC
[R] How to make the cell background of a table informative?
On 12/03/2012 02:41 PM, dweeb wrote:> I wish to create a table in which the foreground is a number (abundance) but > the background is a visual representation of a ratio (shallow:deep). In > other words, the background of each cell of the table would be two colours > or patterns set in a similar fashion to a stacked bar in a bar graph based > on a secondary parameter/vector. > > The table will be extensive (15 by 30) and so I don't want to have to enter > the values for each cell manually, but rather refer to a variable. I have > seen how to create single color backgrounds, and backgrounds of a color that > represents a category, but not a ratio. > > Possible? >Hi dweeb, Have a look at color2D.matplot in the plotrix package. Jim