В Mon, 17 Jun 2024 19:38:21 +0200
Yosu Yurramendi <yosu.yurrame...@gmail.com> пишет:

>   output$distPlot <- renderPlot({
>     numrows <- 3; numcols <- 3
>     a <- c(1,0,1,1,1,1,1,0,1)
>     pattern <- matrix(a, numrows, numcols, byrow=TRUE)
>         palette <- c("#00000000", "black")
>         par(bg="#00000000")
>     #
>     image(t(pattern), col = palette, axes = FALSE)
>   })

Shiny is a bit different.

First of all, try to use the Web Developer toolbar in your browser to
look at the plot image that gets served to you. It could be that the
image has transparent background, but some other element that
encompasses the image may have a non-transparent background. You may
need to style the rest of the output somehow.

If the image does have a non-transparent background, try passing the
argument bg = 'transparent' to renderPlot. The documentation [*] says
that the arguments are passed to plotPNG(...) and, eventually, to
ragg::agg_png(...) / png(...) / Cairo::CairoPNG(), all of which should
support the parameter.

-- 
Best regards,
Ivan

[*] https://search.r-project.org/CRAN/refmans/shiny/html/renderPlot.html

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to