8000 GitHub - joranE/ggqdens: Extension of ggplot2 geom_density that allows for vertical lines at quantiles · GitHub
[go: up one dir, main page]

Skip to content
joranEPublic

About

Extension of ggplot2 geom_density that allows for vertical lines at quantiles

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

ggqdens

ggqdens provides a simple extension of geom_density that allows for drawing vertical lines at specified quantiles.

Installation

You can install the development version of ggqdens from GitHub with:

# install.packages("devtools")
devtools::install_github("joranE/ggqdens")

Example

Here is a basic example:

library(ggqdens)
#> Loading required package: ggplot2
set.seed(123)
data <- data.frame(x = rnorm(1000))
# An ugly example
ggplot(data, aes(x = x)) +
  geom_density_quantile(
    quantiles = c(0.25, 0.5, 0.75),
    quantile_color = c("blue", "red", "green"),
    quantile_linewidth = c(0.5, 1, 1.5),
    quantile_linetype = c("dotted", "dashed", "solid")
  )

# A slightly less ugly example
ggplot(data, aes(x = x)) +
  geom_density_quantile(
    quantiles = c(0.01, 0.5, 0.99),
    quantile_color = "blue",
    quantile_linewidth = 0.8,
    quantile_linetype = "dotted"
  )

About

Extension of ggplot2 geom_density that allows for vertical lines at quantiles

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0