title: How can I increase the absolute size of my ggplot2 graphs in R Shiny?
body: <p>I have an R Shiny app that takes in user csv files and plots graphs of the csv files.</p>
  
  <p>My R Shiny program is using a tabsetPanel, and this shrinks the graphs more than I'd like.</p>
  
  <p>Is there a property in ggplot() that I can add to increase the size of the graph?</p>
  
  <p>I've also noticed that when I try to plot multiple graphs in a tab, I can only go to 2 rows of graphs because the height of the UI is limited. How can I extend this?</p>
  
  <p>For now I have one tab but I plan to add more later.</p>
  
  <p>Here is my code:</p>
  
  <p>ui.R</p>
  
  <pre><code>dataset &lt;- list('Upload a file'=c(1))
  
  shinyUI(pageWithSidebar(
  
    headerPanel(''),
  
    sidebarPanel(
  
       wellPanel(
          fileInput('file', 'Data file'),
          radioButtons('format', 'Format', c('CSV', 'TSV'))
        ),
  
       wellPanel(
            selectInput('xMulti', 'X', names(dataset)),
            selectInput('yMulti', 'Y', names(dataset),  multiple=T)
  
                                                     )
  
        wellPanel(
            checkboxInput('normalize', 'Normalize y axes', value=TRUE)
        ),
  
  
        wellPanel(
            sliderInput("cols", 
             "Plots per row", 
             min = 1, 
             max = 4, 
             value = 2
            )
        )
    )
  
    mainPanel( 
        tabsetPanel(
            tabPanel("Multiplot", plotOutput('plotMulti'), value="multi"),
             id="tsp"            #id of tab
             )
  
  
    )
  ))
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(reshape2)
  library(googleVis)
  library(ggplot2)
  
  #Increase max upload size 
  options(shiny.maxRequestSize=-1)
  
  shinyServer(function(input, output, session) {
  
  
         data &lt;- reactive({
  
      if (is.null(input$file))
        return(NULL)
      else if (identical(input$format, 'CSV'))
        return(read.csv(input$file$datapath))
      else
        return(read.delim(input$file$datapath))
    })
  
    observe({
      df &lt;- data()
      str(names(df))
  
  
      if (!is.null(df)) {
  
        updateSelectInput(session, 'xMulti', choices = names(df))
        updateSelectInput(session, 'yMulti', choices = names(df))
  
  
      }
    })
  
  
  
       # Multiple plot function
    #
    # ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)
    # - cols:   Number of columns in layout
    # - layout: A matrix specifying the layout. If present, 'cols' is ignored.
    #
    # If the layout is something like matrix(c(1,2,3,3), nrow=2, byrow=TRUE),
    # then plot 1 will go in the upper left, 2 will go in the upper right, and
    # 3 will go all the way across the bottom.
    #
    multiplot &lt;- function(..., plotlist=NULL, file, cols=1, layout=NULL) {
      require(grid)
  
      # Make a list from the ... arguments and plotlist
      plots &lt;- c(list(...), plotlist)
  
      numPlots = length(plots)
  
      # If layout is NULL, then use 'cols' to determine layout
      if (is.null(layout)) {
        # Make the panel
        # ncol: Number of columns of plots
        # nrow: Number of rows needed, calculated from # of cols
        layout &lt;- matrix(seq(1, cols * ceiling(numPlots/cols)),
                         ncol = cols, nrow = ceiling(numPlots/cols))
      }
  
      if (numPlots==1) {
        print(plots[[1]])
  
      } else {
        # Set up the page
        grid.newpage()
        pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout))))
  
        # Make each plot, in the correct location
        for (i in 1:numPlots) {
          # Get the i,j matrix positions of the regions that contain this subplot
          matchidx &lt;- as.data.frame(which(layout == i, arr.ind = TRUE))
  
          print(plots[[i]], vp = viewport(layout.pos.row = matchidx$row,
                                          layout.pos.col = matchidx$col))
        }
      }
    }
  
    output$plotMulti &lt;- renderPlot({
      if (is.null(data()))
        return(NULL)
  
  
      plots &lt;- list() # new empty list
      names &lt;- input$yMulti
  
      maxVal &lt;- 0
  
      for (i in 1:length(input$yMulti)) {
        maxVal &lt;- max(maxVal, max(data()[names[i]]))
      }
  
      for (i in 1:length(input$yMulti)) {
        temp &lt;- input$xMulti
  
  
        p &lt;- ggplot(data(), aes_string(x=temp, y=names[i])) 
        p &lt;- p + opts(axis.text.x=theme_text(angle=45, hjust=1, vjust=1))
        p &lt;- p + labs(title=paste("",input$xMulti," VS ",input$yMulti,""))
        h &lt;- ggplot(data(), aes_string(x=temp)) 
        h &lt;- h + opts(axis.text.x=theme_text(angle=45, hjust=1, vjust=1))
        h &lt;- h + labs(title=paste("",input$xMulti," VS ",input$yMulti,""))
  
        if (input$normalize) {
          p &lt;- p + scale_y_continuous(limits = c(0, maxVal))
          h &lt;- h + scale_y_continuous(limits = c(0, maxVal))
        }
  
        if (input$type == "Scatter") {
          p &lt;- p + geom_point(size = 3)
          plots[[i]] &lt;- p
        } else if (input$type == "Line"){
          p &lt;- p + geom_line(aes(group=1)) + geom_point()
          plots[[i]] &lt;- p
        } else if (input$type == "Bar") {
          p &lt;- p + geom_bar()
          plots[[i]] &lt;- p
        } else if (input$type == "Histogram") {
          h &lt;- h + geom_histogram(aes(fill = ..count..))
          h &lt;- h + scale_fill_gradient("Count", low = "green", high = "red")
          plots[[i]] &lt;- h
        }
  
      }
  
  
      multiplot(plotlist = plots, cols=input$cols)
  
  
    })
  })
  </code></pre>