Displaying 11 results from an estimated 11 matches for "rect2".
Did you mean:
rect
2002 Mar 21
1
legend - bug with argument angle (PR#1404)
...not only the
boxes beside the legend text, but also the whole legend box is filled
with shading lines.
I think this is not intended:
plot(1:10)
legend(8, 4, c("A", "B"), angle=c(10, 80), fill=NULL, density=20)
I'd suggest as a fix (legend.R of R-1.5.0):
25c25
< rect2 <- function(left, top, dx, dy, ...) {
---
> rect2 <- function(left, top, dx, dy, angle, ...) {
133c133
< rect2(left, top, dx = w, dy = h, col = bg)
---
> rect2(left, top, dx = w, dy = h, col = bg, angle = NULL)
141c141
< rect2(left=xt, top=yt+ybox/2, dx = xbox, dy...
2008 Feb 08
0
[PATCH] Make outputDeviceForGeometry behave smarter when dealing with overlapping outputs. Currently, the current output is returned if some part of the rectangle is on it; otherwise the output device the rectangle center is on is returned. This works
...clude <sys/types.h>
#include <unistd.h>
#include <assert.h>
+#include <limits.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -3953,6 +3954,27 @@ viewportForGeometry (CompScreen *s,
}
}
+static int
+rectangleOverlapArea (BOX *rect1,
+ BOX *rect2)
+{
+ int left, right, top, bottom;
+
+ /* extents of overlapping rectangle */
+ left = MAX (rect1->x1, rect2->x1);
+ right = MIN (rect1->x2, rect2->x2);
+ top = MAX (rect1->y1, rect2->y1);
+ bottom = MIN (rect1->y2, rect2->y2);
+
+ if (left > right |...
2003 Feb 24
2
"trace" argument in legend() (PR#2578)
...easy fix...
Consider the examble below:
plot(0,0)
legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T)
It gives the following trace:
> plot(0,0)
> legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T)
xchar= 0.05178 ; (yextra,ychar)= 0 0.07941
rect2(0,0, w=0.3474, h=0.2382...)
segments2(0.015540.01554,-0.07941-0.1588, dx=0.1036, dy=0, ...)
points2( 0.06732 0.06732 , -0.07941 -0.1588 , pch= 1 2 ...)
On the line starting by "segment2", the coordinates are not separated
by a space like on the line starting by "points2"....
2009 Aug 27
1
Wishlist: specify the border color of boxes in legend() (PR#13913)
...n in
a legend, so that the legend can match exactly the colors of the actual
plot (e.g. in the case of two superimposed histograms which have
different shading and different borders).
Indeed, the legend function seems to hard code the color "black" for the
borders in this call:
rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox,
col = fill, density = density, angle = angle,
border = "black")
I worked around this by adding a "border" argument to the function
(which defaults to "black"), and changing the call abo...
2004 Mar 25
1
Error in 'legend' help?
Dear all,
maybe I have misunderstood something but to me it seems like a minor error
in the help for
?legend
for the argument 'bg'. There it says:
bg: the background color for the legend box. (Note that this is
only used if 'bty = "n"'.)
I think, however, that it should be changed to:
bg: the background color for the legend box. (Note that this
2008 Jul 27
1
Color of box frame in Legend (Was: Matrix barplot)
On Sun, 27 Jul 2008, S Ellison wrote:
> Looking at the legend() source the filled box line colour is hardcoded :
> if (mfill) {
> if (plot) {
> fill <- rep(fill, length.out = n.leg)
> rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox,
> col = fill, density = density, angle = angle,
> border = "black")
> }
> xt <- xt + dx.fill
> }
>
> ... so it looks like you can have any colour as long as it's...
2004 Nov 08
1
whishlist: legend - changing color of the boxes-border
...hanged. To get this option only a *minimal* change is required.
Please consider the following code snipped copied from the function legend (package graphics).
The sensible line is marked by ###<-
if (mfill) {
if (plot) {
fill <- rep(fill, length.out = n.leg)
rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox,
col = fill, density = density, angle = angle,
border = "black") ####<--
}
xt <- xt + dx.fill
}
Changing this line from...
2001 Aug 27
1
colorbar legend for image()
Hi,
are there any plans to add a colorbar legend to image()?
Or such a possibility already implemented which I just haven't
discovered yet. Anyway, I will be willing to spent some time on the
implementation if there isn't anyone working on that already.
Thanks
Thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2000 May 31
1
legend with multiple columns
...& !merge) w0 <- w0 + dx.pch
! if(do.lines) w0 <- w0 + (2+x.off) * xchar
! w <- w0*ncol+xchar
##-- (w,h) are now the final box width/height.
left <- x - xjust * w
top <- y + (1 - yjust) * h
***************
*** 112,119 ****
rect2(left, top, dx = w, dy = h, col = bg)
## (xt[],yt[]) := 'current' vectors of (x/y) legend text
! xt <- rep(left, n.leg) + xchar
! yt <- top - (1:n.leg) * ychar
if (!missing(fill)) { #- draw filled boxes -------------
fill <- rep(fill, lengt...
1999 Apr 30
1
legend()
In legend() is it possibly to mix lines and boxes? I would like to do
something like
legend(locator(1), legend = c("al", "ben", "chris", "dave"), lty =
c(1, 2, 3, NA), fill = c(NA, NA, NA, "gray"))
to indicate that "al", "ben" and "chris" have lines, and "dave" has a gray
shading.
Many thanks,
2011 Feb 28
0
Fwd: Re: speed up process
...9.09 0.00 0.00
legend 0.02 9.09 0.00 0.00
localAxis 0.02 9.09 0.00 0.00
localBox 0.02 9.09 0.00 0.00
par 0.02 9.09 0.00 0.00
rect 0.02 9.09 0.00 0.00
rect2 0.02 9.09 0.00 0.00
$sample.interval
[1] 0.02
$sampling.time
[1] 0.22
sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=Englis...