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.
2 parents d0c46d8 + fa87c40 commit 8f7c348Copy full SHA for 8f7c348
NEWS
@@ -13,6 +13,8 @@ BUG FIXES
13
and inherited aesthetic mappings like colour. It no longer does this. (Fixes
14
#767)
15
16
+* Plots with geom_crossbar not display correct symbol in legend. (Fixes #768)
17
+
18
ggplot2 0.9.3
19
----------------------------------------------------------------
20
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