ggplotly: log argument cancels axis labels

∥☆過路亽.° 提交于 2019-12-01 18:38:16

You can get axis names if you supply them as arguments to scale_... function.

qplot(wt, mpg, data=mtcars, colour=factor(cyl)) + scale_x_log10("wt")
ggplotly()
MLavoie

or maybe this?

ggplot(data = mtcars, aes(x = log10(wt), y=mpg, colour = factor(cyl))) + 
  geom_point() + 
  scale_x_continuous("wt, log10-scaling")

ggplotly()

Maybe this:

gg <- ggplot(mtcars, aes(x=wt, y=mpg)) + 
  geom_point() + coord_trans(y="log10")
ggplotly(gg) %>% layout(yaxis = list(type="log", autorange=TRUE))

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!