Displaying 3 results from an estimated 3 matches for "colorstrip".
2009 Sep 28
2
dichromat, regexp, and grid objects
Dear list,
The dichromat package defines a dichromat function which "Collapses
red-green color distinctions to approximate the effect of the two
common forms of red-green colour blindness, protanopia and
deuteranopia."
library(dichromat)
library(grid)
colorStrip <-
function (colors = 1:3, draw = TRUE)
{
x <- seq(0, 1 - 1/length(colors), length = length(colors))
y <- rep(0.5, length(colors))
my.grob <- grid.rect(x = unit(x, "npc"), y = unit(y, "npc"),
width = unit(1/length(colors), "npc&quo...
2011 Jul 15
2
plot a vertical column of colored rectangles
Hi, I've been really struggling with this.
If I have a vector like
dat <- c(0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,0)
I want to plot each element as a colored rectangle (red=1, blue=1) in the
right order, so they all stack up forming a vertical column on the graph.
Sort of like a building, with each floor in the appropriate color.
Any ideas?
I've tried using ggplot and geom_tile, but my
2011 Oct 19
2
Simple color strip
Hi,
I was trying to get an image/pdf of a sequence of colors in the order given.
For example:
myCols <- c('#0000BF','#0000BF','#0000FF','#0000FF','#0000BF','#0000FF')
I'd like to make a strip of colors as they appear in the order above and
save it as a pdf file. Is there a function in the base package (or some
other package) to do this?