Display more than 2 decimal places in plotly boxplot

options(digits = 4) does not have any effect on the number of decimal places in a boxplot’s hover info; numbers are still rounded to 2 digits. Please see the following examples https://plot.ly/ggplot2/box-plots/

Hi @PeterRowan

Try using hoverformat = '.4f' https://plot.ly/r/reference/#layout-yaxis-hoverformat For example,


dat <- data.frame(cond = factor(rep(c("A","B"), each=200)), rating = c(rnorm(200),rnorm(200, mean=.8)))

p <- ggplot(dat, aes(x=cond, y=rating)) + geom_boxplot()

p <- ggplotly(p) %>% layout(yaxis = list(hoverformat = '.4f'))

Hi Branden,

Thank you so much. It works as expected.