Skip to content

Instantly share code, notes, and snippets.

@chris-prener
Created September 9, 2018 21:47
Show Gist options
  • Save chris-prener/12f3f63046dfa8200477dd89018e9dec to your computer and use it in GitHub Desktop.
Save chris-prener/12f3f63046dfa8200477dd89018e9dec to your computer and use it in GitHub Desktop.
library(dplyr)
library(ggplot2)
library(latex2exp)
abline <- as_tibble(data.frame(
xmin = c(0),
xmax = c(10),
ymin = c(5),
ymax = c(5)
))
ggplot() +
geom_segment(data = abline, mapping = aes(x = xmin, xend = xmax, y = ymin, yend = ymax),
colour = "#E84C06", size = 1.5) +
scale_x_continuous(breaks = c(0,2,4,6,8,10)) +
scale_y_continuous(limits = c(0,10), breaks = c(0,2,4,6,8,10)) +
labs(
title = TeX('Simulated Distribution with $\\bar{x}$'),
x = "i",
y = "x"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment