为什么条形图的负条没有显示在闪亮的应用程序中

时间:2016-11-22 10:25:42

标签: r ggplot2 shiny

最近我正在制作一个闪亮的项目,想要制作一个带有renderplotly(ggplot对象)的条形图。为什么条形图的负条没有显示在闪亮的应用程序中?不显示负面部分。有什么理由吗?我的代码无关紧要,但它是

我的代码:

g_dpnl_ts <- ggplot(aes(x=time), data=dpnl_ts) +
    geom_bar(aes(y=value), fill = "dodgerblue4", stat="identity", size=0.5) + # Specify bar ts plot
    geom_abline(slope = 0, intercept = 0, aes(color="red")) + # horizontal line @ y=0
    xlab("Period of Observation") + ylab("Millions of US Dollars ($)") + # label
    #scale_fill_manual(values = c("tomato", "forestgreen")) + #For conditional coloring
    theme(legend.position = "none") + #turn off the legends
    scale_x_date(date_breaks = "1 month", date_labels = "%b", date_minor_breaks = "1 month") + #Add x-axis ticks
    theme(axis.text = element_text(size = rel(1.25))) + # Change axis label text size
    theme(axis.title.x = element_blank()) # Remove x-axis label

The negative area is omitted.

1 个答案:

答案 0 :(得分:0)

这个讨论可以帮到你吗? https://github.com/ropensci/plotly/issues/560