ggplot和plotly中的错误

时间:2015-09-01 18:22:01

标签: r ggplot2 shiny rstudio plotly

当我尝试使用绘图的界面在r-shiny上使用ggplot绘制我的双条形图时,双条形图从随机位置获取数据并且无法正确绘制图形。

我在单条形图上使用了这个界面,它完美正常地显示了数据和图形,但是使用双条形图,它只是使用随机数据?常规的ggplot情节很好但是当我把它变成情节时它会搞砸了。

output$tvpn <- renderPlotly({

     mpolfinal4$Partner.Name= factor(mpolfinal4$Partner.Name,
                                       levels=names(sort(table(mpolfinal4$Partner.Name),
                                                    decreasing=TRUE)))
     tv =  ggplot(mpolfinal4, aes(x =Partner.Name, fill=Domain.Name)) +
             geom_bar(colour="black") + 
             theme(axis.text.x=element_text(angle=90,hjust=1)) + 
             ggtitle("Total Views by Partner Name, and Domain Name")

     out = ggplotly(tv)
     out
  })

有没有人遇到过这个问题/知道如何修复它?

0 个答案:

没有答案