My ggplotly() output is not displaying vertical and horizontal lines properly on graphs using geom_hline() and geom_vline(). The problem occurs whether I display the graph in R Studio or publish it to plotly using the plotly_POST command, and whether I am using my own data or the example code from the documentation. Here is an example of the code:
x1 <- factor(c('a', 'b', 'c'))
y1 <- c(1, 2, 3)
df <- data.frame(x1,y1)
ggplot(data=df, aes(x=x1, y=y1)) +
geom_bar(stat="identity") +
geom_hline(yintercept=1.5)
p <- ggplotly()
plotly_POST(p, filename='NPL_bar')
The ggplotly output can be viewed here. There should be a horizontal line on the graph with y-intercept = 1.5, but what displays is a sloped line instead.
R Studio Desktop version:
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 2.3
year 2015
month 12
day 10
svn rev 69752
language R
version.string R version 3.2.3 (2015-12-10)
nickname Wooden Christmas-Tree