Overlay vertical line on top of histogram in R using Plotly

Viewed 3391

I have an histogram like the one below and I want to plot a vertical line of a specific value on top of the histogram.

My code for the histogram is:

library(plotly)
p <- plot_ly(x = ~rnorm(50,mean = 50,sd = 10), type = "histogram")
p

I want to overlay a line on top of the histogram, for example say,

x <- 42

enter image description here

Can anyone help getting this?

1 Answers
Related