We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0c46d8 commit 6dd669bCopy full SHA for 6dd669b
R/geom-crossbar.r
@@ -29,7 +29,15 @@ GeomCrossbar <- proto(Geom, {
29
default_pos <- function(.) PositionIdentity
30
default_aes = function(.) aes(colour="black", fill=NA, size=0.5, linetype=1, alpha = NA)
31
required_aes <- c("x", "y", "ymin", "ymax")
32
- guide_geom <- function(.) "path"
+ guide_geom <- function(.) "crossbar"
33
+ draw_legend <- function(., data, ...) {
34
+ data <- aesdefaults(data, .$default_aes(), list(...))
35
+ gp <- with(data, gpar(col=colour, fill=alpha(fill, alpha), lwd=size * .pt, lty = linetype))
36
+ gTree(gp = gp, children = gList(
37
+ rectGrob(height=0.5, width=0.75),
38
+ linesGrob(c(0.125, 0.875), 0.5)
39
+ ))
40
+ }
41
42
draw <- function(., data, scales, coordinates, fatten = 2, width = NULL, ...) {
43
middle <- transform(data, x = xmin, xend = xmax, yend = y, size = size * fatten, alpha = NA)
0 commit comments