Skip to content

Instantly share code, notes, and snippets.

@dotRData
Created February 11, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotRData/9510d2ce8ff66edbd7334961de01bed9 to your computer and use it in GitHub Desktop.
Save dotRData/9510d2ce8ff66edbd7334961de01bed9 to your computer and use it in GitHub Desktop.
library(ggplot2)
library(data.table)
ggplot(data.table(x=c(-2, 2)), aes(x)) +
stat_function(fun=function(x) sqrt(1 - (abs(x)-1)^2), color='red', size=3) +
stat_function(fun=function(x) -3*sqrt(1 - (sqrt(abs(x))/sqrt(2))), color='red', size=3) +
theme(legend.position = "none",
panel.background = element_rect(fill = "black"),
axis.ticks = element_blank(),
panel.grid = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment