【问题标题】:ternary plot of ggtern not working in shinyggtern 的三元图在闪亮时不起作用
【发布时间】:2019-08-01 17:37:43
【问题描述】:

我想在闪亮的应用程序中使用ggtern() 的输出。但是,由于某些限制,它似乎失败了。

它应该是这样的:

这是实际的闪亮输出:

请参阅此处以获取可重现的示例:

library(shiny)
library(ggtern)

ui <- fluidPage(
        mainPanel(
           plotOutput("ggtern")
        )
)
server <- function(input, output) {
    output$ggtern <- renderPlot({
        ggtern(data.frame(x=10, y=30, z=60), aes(x, y, z)) + geom_point()
    })
}
shinyApp(ui = ui, server = server)

我忽略了什么吗?

【问题讨论】:

    标签: r ggplot2 shiny shiny-reactivity ggtern


    【解决方案1】:

    将绘图函数放在print 命令中:

     output$ggtern <- renderPlot({
            print(ggtern(data.frame(x=10, y=30, z=60), aes(x, y, z)) + geom_point())
        })
    

    【讨论】:

      猜你喜欢
      • 2018-09-25
      • 1970-01-01
      • 1970-01-01
      • 2020-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      相关资源
      最近更新 更多