We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To do basically this, but then in a stat function:
library(ggplot2) df <- data.frame( x = seq(0, 10, length.out = 100), y = sin(seq(0, 10, length.out = 100)) ) rle <- rle(df$y > 0.5) start <- {end <- cumsum(rle$lengths)} - rle$lengths + 1 df2 <- data.frame( xmin = df$x[start], xmax = df$x[end], value = rle$values ) ggplot(df) + geom_rect(data = df2, aes(xmin = xmin, xmax = xmax, ymin = -Inf, ymax = Inf, fill = value)) + geom_point(aes(x, y))
Created on 2020-05-22 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered:
This now works:
library(ggplot2) library(ggh4x) df <- data.frame( x = seq(0, 10, length.out = 100), y = sin(seq(0, 10, length.out = 100)*2) ) ggplot(df) + stat_rle(aes(x, label = y > 0.5), align = "center") + geom_point(aes(x, y))
Created on 2020-06-02 by the reprex package (v0.3.0)
Sorry, something went wrong.
No branches or pull requests
To do basically this, but then in a stat function:
Created on 2020-05-22 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: