Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix ggplot2 output

  • Loading branch information...
commit afe35917be4c56c9178db7c5a7cf3b6deb6035e5 1 parent b92eebe
@hadley authored
Showing with 7 additions and 7 deletions.
  1. +2 −0  NEWS
  2. +5 −7 R/output.r
View
2  NEWS
@@ -6,6 +6,8 @@ Version 0.3
* Corrected bug in parsing that lead to incorrect collapsing of non-adjacent
functions
+* Get `ggplot2.profr` working again.
+
Changes in version 0.2
------------------------------------------------------------------------------
View
12 R/output.r
@@ -47,14 +47,12 @@ ggplot.profr <- function(data, ..., minlabel = 0.1, angle=0) {
stop("Please install ggplot2 to use this plotting method")
data$range <- diff(range(data$time))
- ggplot(as.data.frame(data), aes(x = factor(level))) +
- geom_bar(aes(min = start, y = end),
- position = "identity", stat = "identity",
- width = 1, fill = "grey95", colour = "black", size = 0.5) +
- geom_text(aes(label = f, y = start + range/60),
+ ggplot(as.data.frame(data)) +
+ geom_rect(aes(xmin = start, xmax = end, ymin = level - 0.5, ymax = level + 0.5),
+ fill = "grey95", colour = "black", size = 0.5) +
+ geom_text(aes(start + range / 60, level, label = f),
data = subset(data, time > max(time) * minlabel),
size = 4, angle = angle, hjust = 0) +
scale_y_continuous("time") +
- scale_x_discrete("level") +
- coord_flip()
+ scale_x_continuous("level")
}
Please sign in to comment.
Something went wrong with that request. Please try again.