Labelling logarithmic scale display in R

前端 未结 3 745
孤城傲影
孤城傲影 2020-12-30 03:35

While plotting histogarm, scatterplots and other plots with axes scaled to logarithmic scale in R, how is it possible to use labels such as 10^-1 10^0 10^1 10^2 10^3 and so

3条回答
  •  一生所求
    2020-12-30 03:46

    In ggplot2 you just can add a

    ... + 
    scale_x_log10() + 
    scale_y_log10(limits = c(1e-4,1), breaks=c(1e-4,1e-3,1e-2,0.1,1)) + ...
    

    to scale your axis, Label them and add custom breaks.

提交回复
热议问题