renderImage() and imageOutput() : width and height

196 views
Skip to first unread message

Stéphane Laurent

unread,
Oct 22, 2013, 11:53:57 AM10/22/13
to shiny-...@googlegroups.com
I create a plot called "gg" in renderImage() :

output$pairplot <- renderImage({
   ....
    outfile <- tempfile(fileext='.png')
    png(file = outfile, width=1200, height=700)  
    print(gg)
    dev.off()
    # Return a list
    list(src = outfile, 
         contentType = 'image/png',
         alt = "This is alternate text")
})

and then I type imageOutput("pairPlot") in ui.R. But the plot does not appear correctly : the bottom of the plot does not appear.

It even doesn't work when I type :
    # Return a list
    list(src = outfile, 
         contentType = 'image/png',
         alt = "This is alternate text"), 
         width=1200, 
         height=1000) 

What should I do to get the correct rendering ?

Stéphane Laurent

unread,
Nov 22, 2013, 6:43:39 AM11/22/13
to shiny-...@googlegroups.com
imageOutput("pairPlot", height="auto") works fine. 
Reply all
Reply to author
Forward
0 new messages