ggplotly: log argument cancels axis labels

前端 未结 3 1620
無奈伤痛
無奈伤痛 2021-01-20 03:41

I just discovered the newish ggplotly function that makes ggplot2 graphs into interactive plotly visualizations. This is great. But I also ran into an odd effect, possibly a

相关标签:
3条回答
  • 2021-01-20 04:20

    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()
    
    0 讨论(0)
  • 2021-01-20 04:30

    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))
    

    0 讨论(0)
  • 2021-01-20 04:36

    or maybe this?

    ggplot(data = mtcars, aes(x = log10(wt), y=mpg, colour = factor(cyl))) + 
      geom_point() + 
      scale_x_continuous("wt, log10-scaling")
    
    ggplotly()
    
    0 讨论(0)
提交回复
热议问题