similar to: rect function

Displaying 20 results from an estimated 10000 matches similar to: "rect function"

2009 Oct 19
3
loop and plot
Dear all, I am stuck at applying loop function for creating separated plots. I have coding like below: dataset.table <- table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c("a","b","c","c","a","b","b") )) kk = function(f) { ls=as.character(f) pie(dataset.table[ls,],main=ls)
2008 Jul 26
1
the C function drawing a rectangle: heatmap() -> image() -> do_image() -> GRect() -> GERect() -> rect() -> do_rect() -> GRect() ??
Hello anyone used to do similar things: search for the final C function that corresponding to the drawing of a rectangle? As listed in the subject, I started from heatmap() in R and after several steps reached the GRect() in C. However, then it refers to rect() which further seems to refer to do_rect(), and then, surpringly, do_rect refers to GRect()!!! A dependency circle! How can it work if no
2010 Dec 01
2
How to draw a rect() behind a hist() ?
Hi, I have the following code: hist(gps$heartpercent, breaks=5) rect(90, par("usr")[3], 100, par("usr")[4], col = "red") How do I get the rectangle to appear behind the histogram. Barring that, how can I make certain bars of the histogram to be a certain color? Thanks, Jason
2006 Nov 24
2
axis in an image() plot
Hi all, I've found quite usefull colored-grid created by image() but I'm facing a doubt I am not able to solve. Given the following data rectangle... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 12 22 0 7 2 1 0 2 0 2 6 -3 0 3 2 0 -1 0 9 3 -4 0 0 0 0 3 0 0 0 3 29 45 6 12 16 85 -2 0 -3 -4 89 -1 -1 1 4 2 9 3 6 17 3 -2 -9 -2 8
2000 Aug 21
2
rect() question.
Hello. I have another rect question. If I want to make a lot of rectangular, without borders, and without any spaces between them, how could I do it? I.e. > plot(-1:1., -1:1., type = "n") > rect(0,-1,1,1,col="red",lwd=0,border=F,xpd=T) > rect(-1,-1,0,1,col="blue",lwd=0,border=F,xpd=T) will produce two rectangular, but there is space between them. How
2005 Dec 08
1
grid graphics gpar(fill) argument and jpeg device
Hi everybody, I just notice a strange behaviour of gpar's fill argument when using non-postscript devices: The default of the argument is transparent (according to get.gpar("fill")). So as expected, the following code draws a nice red rectangle in the middle of my X11 or postscript device. pushViewport(viewport(width=0.5, height=0.5)) grid.rect(gp=gpar(fill="red"))
2002 Jun 10
2
Crashing R (PR#1651)
Concerns: R 1.5.0 gui version, Windows (downloaded binary) and Linux (installed from sources). # Load the data from the attached file: kk<-read.table("__filename__", header=1) # attach the data: attach(kk) Snr<-factor(Snr) # fool around with a call to anova.glm(): anova.glm( aov( nFD~Type+size+Modality+Error(Snr/(Type+size+Modality)) ) ) # Error: object nFD not found # Well, I
2011 Oct 08
2
[R ]Plot a colored rectangle under the points of a graph
Hello everyone, if I have: x=1:10 y=1:10 plot(x,y) and I plot a rectangle rect(4,0,6,11, col=5) it covers the points of the graph. Is there a way to draw the rectangle under the points? I was thinking the a solution could be draw an empty plot then draw the rectangle and after the points, but it did not work. Any idea? thanks for your help H. [[alternative HTML version deleted]]
2006 Jul 29
3
placing rectangle behind plot
I am trying to create a lattice plot and would like to later, i.e. after the plot is drawn, add a grey rectangle behind a portion of it. The following works except that the rectrangle is on top of and obscures a portion of the chart. I also tried adding col = "transparent" to the gpar list but that did not help -- I am on windows and perhaps the windows device does not support
2012 Oct 09
2
plot.new() and grid functions in multipage pdfs
Hi, when using the grid package, I've come across this weird behaviour where a call to plot.new() will start a new page for a multi-page pdf, but then the margins will somehow behave strangely for all but the first page: here is some code: pdf("test.pdf"); plot.new(); grid.rect(gp = gpar(fill="blue")); plot.new(); grid.rect(gp = gpar(fill="blue")); dev.off()
2004 Apr 05
1
rect.hclust fails when k is specified (PR#6740)
Full_Name: Ivan Egorov Version: 1.8.1 OS: MS Windows 2000, SP4 Submission from: (NULL) (194.186.91.129) V<-t(matrix(scan('C:/V3.dat'),3)) d<-dist(V) hc<-hclust(d) rect.hclust(hc,5) Error message is displayed: Read 24 items Error in rect(m[which[n]] + 0.66, par("usr")[3], m[which[n] + 1] + 0.33, : plot.new has not been called yet Here's my data file
2010 Aug 15
2
Adding colored background area to a time series plot
Hi, I am trying to add a rectangular colored background area to a plot of a time series of relative price changes. I believe that what I'm trying to do is very similar to the question and example given here: http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg73948.html http://www.mayin.org/ajayshah/KB/R/html/g5.html My problem/difference is that my time series looks like so: >
2004 Dec 02
2
Drawing a rectangle around a barplot()
Hi I want to draw a rectangle behind a barplot such that it highlights those particular bars from the rest of the plot. I have figured out how to draw a barplot(), and then how to draw a rectangle of the correct shape and size (using rect()), but when I use rect() it draws over the top of the bars, and then when I re-draw the bars, it draws with a white background, thus eliminating my rectangle!
2004 Dec 14
2
drawing a rectangle through multiple plots
How do I draw a rectangle across multiple plots on a device? E.g., def.par <- par(no.readonly = TRUE) par(mfrow = c(3, 1)) plot(1:10, rnorm(10), ylim = c(-4,4), type = "l") plot(1:10, rnorm(10), ylim = c(-4,4), type = "l") plot(1:10, rnorm(10), ylim = c(-4,4), type = "l") rect(2, -4, 3, 4) par(def.par) I want the rectangle to extend across the whole device. How
2005 Mar 17
1
Varying grid.rect in different panels of a Lattice plot
Dear r-help, Sleep-deprivation from having 2 youngsters under 2 around the house is fuzzing my brain, so please be gentle if the answer to this query is obvious! In the example below, I'm trying to use grid.rect to add grey rectangles to the panels of a lattice plot to indicate which months spawning occurred of a (very cute) native Tasmanian fish. The fish in the two lakes spawned at
2008 Apr 08
2
diagonally fill a rectangle with color gradient
Hi, Is it possible to diagonally fill a rectangle with a color gradient? I noticed that the gradient.rect of plotrix could fill a rect either up and down or from side to side. I am looking for something similar but fills diagonally instead, e.g., from the upper left corner to the bottom right. Does anyone know how to do it in R? Thanks, -- Tom [[alternative HTML version deleted]]
2007 Jan 24
2
modify rectangle color from image
Hi, I need some suggestion on how I could modify the color on some rectangle that I have created using "image". In other words, I have a 5x5 matrix, say, m. m <- matrix(rnorm(25), nrow=5) I create a grid of rectangles by: image(m) Now I want to change the color of rectangle (3,3) to blue. I don't know how this could be done, and searching the web has
2004 Sep 23
1
Gridbase basic question
All, I have a simple plot(x,y) and I would like to then insert rectangles of some length (in native coordinates) and height fixed to 0.5 in native coordinates. I can't quite get the code right to do this. Can anyone give me a quick example of how to do this? I looked the gridBase index and the tutorial (from R-news?) but just haven't gotten it down yet. > plot(1:10,1:10)
2008 Feb 27
2
Add a rectangle behind a plot
Hi there, I found one reference to add a reactangle behind a plot using plot(...,add=T), I tried this but didn't obtain the desired result. If a I have the following code: plot(x,y) rect(xleft, ybottom, xright,ytop,col='green) The rectangle appear on top of the plot. Any help will be greatly appreciated, Judith
2013 Oct 25
1
add a color band
Hi all, I would like to ask your help to add a color band (Ι am not sure regarding the right term, this color band at the right of the plot "describing" values with their corresponding color. For now I have only this code test<-matrix(data=runif(10000),nrow=100) plot(test,axes="FALSE") axis(1,at=c(0,1),labels=c("a","b")) # but  I would like to add