UUPharmacometrics/xpose

Plot points with no-fill shape do not appear in Shiny

certara-jcraig opened this issue · 2 comments

Hello,

I have observed an issue when rendering xpose plots in Shiny. Points with no-fill shape do not appear, while points with fill shape do appear. Please note the issue only appears in shiny >= 1.7.0. Furthermore, when simply using ggplot2 library with no fill shapes, the points render as expected in Shiny.

library(shiny)
library(xpose)

#point shape 1 - circle no fill does not work
#point shape 16 - circle with fill works
plot <- res_vs_idv(xpdb_ex_pk, res = "IWRES", type = "ps", point_shape = 1) 

ui <- fluidPage(
  fluidRow(
    column(width = 12,
      plotOutput("plot")
    )
  )
)


server <- function(input, output, session){
  
  output$plot <- renderPlot(
    plot
  )
}

shinyApp(ui, server)

Plotting points in ggplot2 with no-fill works as expected

library(shiny)
library(ggplot2)

plot <- ggplot(mtcars,aes(mpg, hp)) + 
  geom_point(shape = 1)



ui <- fluidPage(
  fluidRow(
    column(width = 12,
           plotOutput("plot")
    )
  )
)


server <- function(input, output, session){
  
  output$plot <- renderPlot(
    plot
  )
}

shinyApp(ui, server)

Hello,
I believe you may simply solve this issue by adding using the stroke setting in xpose (read more about stroke here).

For better looking plot I have removed the stroke by default, while in ggplot2 by default points always have a stroke.

Hope it helps,

Ben

@certara-jcraig closing due to inactivity, please reopen if issue still occurs.