Skip to content

geom_bar() + coord_flip() doesn't work #390

Closed
@jseppanen

Description

@jseppanen

When plotting a bar chart with ggplot2 and plotly, the plot is empty on our enterprise plotly server.

This is the expected result:
empty_plot_ggplot

This is what I get with plotly:
empty_plot_plotly

Code:

library(ggplot2)
library(scales)
library(plotly)

d <- read.csv('empty_plot_data.csv.txt')

png('empty_plot_ggplot.png', w=500, h=300, res=96)
p <- ggplot(d, aes(purchase, revenue, fill=currency)) +
    geom_bar(stat='identity') +
    scale_y_continuous(label=dollar) +
    scale_fill_manual(values=c('limegreen', 'orange')) +
    labs(x=NULL, y='Revenue (USD)', title='Stuff bought') +
    coord_flip() +
    theme_bw()
print(p)
dev.off()

t <- plotly_POST(p, filename='empty_plot',
                 fileopt='overwrite', world_readable=TRUE)

csv file:
empty_plot_data.csv.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions