Hi guys,
I'm using rgl and shinyrgl to produce a 3D PCA plot within my Shiny app. I'm then using the legend3d
function to create the legend. As you can see from the image above, the legend is significantly lower resolution than the plot. Has anyone else experienced this problem?
I've included the code being used to draw this below. Since it's Shiny it is a little difficult to produce a full working example. I'm more looking to see if anyone else has fixed this problem.
Matt
UI
tabItem(tabName = "3DTab",
fluidRow(
column(6,
rglwidgetOutput(outputId = "TDPCA")),
column(6,
box(title = "Customisation",
width = NULL,
collapsible = TRUE,
selectizeInput(inputId = "TDPCAClass",
label = "Class",
choices = c("Day"))))
Server
output$TDPCA <- renderRglwidget({
plot3d(x = TDPCA()$PC1, y = TDPCA()$PC2, z = TDPCA()$PC3, col = TDPCA()[[input$TDPCAClass]],
xlab = paste("PC1", "-", TDPCA.var()["PC1"], "%"), ylab = paste("PC2", "-", TDPCA.var()["PC2"], "%"), zlab = paste("PC3", "-", TDPCA.var()["PC3"], "%"), type = "p")
legend3d("topright",
legend = c("Monday", "Tuesday", "Wednesday", "Thursday", "Saturday"),
pch = 16,
col = palette("default"),
cex=0.65, inset=c(0))
rglwidget()
})