0

Is there a functionality to increase plot size? I have +20 features and the plot is cluttered even after reducing font-size.

output$coxplot <- renderPlot({ 
   fit.coxph<- coxph(Surv(time,status) ~ feature1 + feature2 +...+featureN, data=data)
    print(ggforest(fit.coxph, data = dat, fontsize = 0.3,noDigits = 3) )
  })

Trying to render in shiny and adjust the plot height and width or the size but no parameters in ggforest function called "size" but there is "fontsize".

Bhavya Geethika
  • 379
  • 1
  • 2
  • 9
  • 1
    What do you mean by plot size? Are you saving the plot as an image, or just viewing it in your R session? When saving as an image you can pick the size of the image. – Marius Jun 19 '19 at 04:20
  • I am just trying to view it using print. The graph generated per this post - there seems to be no way to increase the size lets say if you are plotting 30 covariates : https://stackoverflow.com/questions/55627999/how-to-add-arrows-to-forest-plot-in-survminer-ggforest/55630623#55630623 – Bhavya Geethika Jun 19 '19 at 04:23
  • 1
    If you're using RStudio, you can make a plot larger by clicking the "zoom" button in the plotting pane (and resize the window if you need it even bigger after that). In R you "print" plots to a device, and there are different ways of controlling the size of each device, so it's a bit hard to know what to do here without knowing how you're viewing the plot. – Marius Jun 19 '19 at 04:27
  • Thank you - I just updated my post. I am actually trying to render it in shiny. So I need to adjust the plot's width and height in shiny. Even without shiny rendering - there is no way to give a size parameter in ggforest function. – Bhavya Geethika Jun 19 '19 at 04:32

1 Answers1

2

@marius: thank you. Your questions hinted me towards answering my own question. in the shiny app, setting size in ui worked instead of in ggforest as a parameter. plotOutput(outputId = "coxplot", height = 750)

Would like to know how to set size parameter in ggforest if I weren't using shiny.

Bhavya Geethika
  • 379
  • 1
  • 2
  • 9