I am using the function ggplotly to create an interactive histogram with a logarithmic x-scale. Unfortunately using 'scale_x_log10()' alters the tooltip values in ggplotly towards the log10 values. I would like to see the original values in the tooltip. I looked for a possible solution, but did not (yet) find one. I noticed on the community page from plotly, that someone else posted a similar question in November (https://community.plot.ly/t/scale-y-log10-alters-tooltip-values-in-ggplotly/2773) but there is not yet a response. I was wondering whether anyone has an idea how to switch the tooltip to showing the original values instead of the logarithmic values.
library(ggplot2)
library(plotly)
test=data.frame(index=c(1:1000), val=runif(1000, 1, 100000))
p <- ggplot(test, aes(x = val)) + geom_histogram(aes(y = ..density..), binwidth = 0.5) + scale_x_log10()
ggplotly(p)