我在 sidebarPanel 中有一个维恩图,需要删除图的背景(白色)并添加与 sidebarPanel 相同的 有什么建议么? 代码是这样的
library(shiny)
ui <- fluidPage(
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30),imageOutput("Vennout")),mainPanel(
plotOutput("distPlot"))))
server <- function(input, output) {
set1 <- paste(rep("word_" , 200) , sample(c(1:1000) , 200 , replace=F) , sep="")
set2 <- paste(rep("word_" , 200) , sample(c(1:1000) , 200 , replace=F) , sep="")
output$Vennout <- renderPlot({
vennplot <-({venn.diagram(
x = list("one" = set1,
"two" = set2),
filename = NULL,
fill = c("orange", "blue"),
alpha = c(0.5,0.5),
label.col = "black",
cat.col = c("cornflowerblue", "pink"),
cat.default.pos = "text",
scaled = FALSE
)}) grid.newpage()
grid.draw(vennplot)})}
shinyApp(ui = ui, server = server)