---
title: ""
output: html_document
runtime: shiny
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(ggplot2)
library(dplyr)
library(shiny)
library(shinythemes)

paper_theme <- theme_light() + theme( axis.title.x = element_text(size=18),
  axis.text.x=element_text(colour="black", 
                           size = 14), 
  axis.title.y = element_text(size = 18, vjust = 1),
  axis.text.y  = element_text(size = 14),
  strip.text=element_text(size=16),
  axis.line.x = element_line(colour = "black"), 
  axis.line.y = element_line(colour = "black"),
  legend.title=element_text(size=14),
  legend.text=element_text(size=12))  

```

```{r}


ui <- basicPage(

  titlePanel(""),

  fluidRow(
        column(12,align="center", plotOutput(outputId = "plot1",height="275px"))

  )
  
)

```


```{r,echo=FALSE}

xs <- seq.int(0.1,15,0.01)
ns <- c(5)

ns <- rep(ns, each=length(xs))
xs <- rep(xs,1)
df <- data.frame(x=xs,n=ns)

df <- df %>%
      mutate(p=dgamma(x,11,scale=0.5)) 



```

```{r,echo=FALSE}


server <- function(input, output) {
  output$plot1 <- renderPlot({
    
        ggplot(data=df,aes(x=x,y=p)) +
      geom_line() +
      geom_area(alpha=0.1) +
      xlab("Estimate") + ylab("Probability Density") +
      paper_theme + theme(legend.position=c(0.88,0.7),legend.key.size = unit(0.5, "cm"))
  })


}

```

```{r}
shinyApp(ui, server)
```