I have a plot that renders with a white background even though I have this in my code:
output$malPie <- renderPlot({
sub <- data
sub <- subset(sub,sub$mal_tested=="1")
drawGraph("pie",sub,factor(sub$mal_tested_pos),"Malaria Tests Done",NULL,"Malaria Tested Positive","Malaria")
})
drawGraph <- function (graphType,dataFrame,xVariable,xLabel,yVariable,yLabel,legendTitle,groupVariable) {
#check graph type
if(!is.null(xVariable)){
if(is.factor(xVariable)){
graphX <- factor(xVariable)
}else{
graphX <- as.factor(xVariable)
}
graphY <- yVariable
}
c <- ggplot(dataFrame, aes(x=factor(nrow(dataFrame)),fill=graphX),environment=environment()) + geom_bar(width = 1)
print(c + coord_polar(theta = "y")+ xlab(xLabel)+ylab(yLabel)+ labs(fill=legendTitle)+ theme(
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
panel.background = element_blank(),
plot.background = element_blank()
))
}
and in my ui.R
plotOutput("malPie", width="95%")
How do I get the plot to have a transparent background???
Tuti
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.