3

I have encountered a very weird situation here. I use shinydashboard and here is a part of body ui:

        tabPanel('Break', icon = icon("adjust", "fa-2x"),
             fluidRow(
               column(6,h4("Break point")),
               column(6,h4("") )
             ),
             fluidRow(
               column(12,plotOutput(outputId = "plot1",height = "auto") )
             ),br(),hr(),
             fluidRow(
               column(12,plotOutput(outputId = "plot2",height = "auto") )
             )
    )

and here is my very simple code to produce one of these graphs:

  output$plot1<-renderPlot({
  res%>%
  ggplot(aes(x=CP, y=LP, z=Pr)) +
   # geom_contour()+
    geom_raster(aes(fill = Pr),alpha=0.85,show.legend = T,interpolate = T)+
    scale_fill_gradient(low = "red2",high = "green4")+
    facet_grid(Year~TS)+
    theme_bw(base_size = 19)+
    theme(legend.position="top",
          strip.text.x = element_text(size = 18),
          strip.text.y = element_text(size = 18),
          panel.grid=element_blank(),
          strip.background = element_blank(),
          axis.line.x = element_line(color="black", size = 0),
          axis.line.y = element_line(color="black", size = 0),
          panel.border = element_blank()
          )+
    guides(fill = guide_legend(keywidth = 3, keyheight = 1))

},height = 800)

but I guess since the height of the plot is set be 'auto' in my Ui, when I produce plots in my server with large heights it messes up things, this : Screen shot Any suggestions ?

Para2x
  • 61
  • 7
  • I would suggest updating the question with a minimal reproducible example - http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Iain Apr 30 '17 at 16:12
  • This discussion might be helpful: http://stackoverflow.com/questions/22408144/r-shiny-plot-with-dynamical-size – Iain Apr 30 '17 at 16:13
  • As you may see in the screen-shot, there is nothing wrong with the plot. There seem to be a problem with how shinydashboard deals with the heights. – Para2x Apr 30 '17 at 16:24

0 Answers0