R ggplot2: using stat_summary (mean) and logarithmic scale

前端 未结 3 1910
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 02:46

I have a bunch of measurements over time and I want to plot them in R. Here is a sample of my data. I\'ve got 6 measurements for each of 4 time points:

value         


        
3条回答
  •  甜味超标
    2020-12-07 03:37

    The best solution I found for this issue was to use a combo of coord_trans() and scale_y_continuous(breaks = breaks)

    As previously suggested, using coord_trans will scale your axis without transforming the data, however it will leave you with an ugly axis.

    Setting the limits in coord_trans works for some things, but if you want to fix your axis to have specific labels, you will then include scale_y_continuous with the breaks you'd like set.

    coord_trans(y = 'log10') +
    scale_y_continuous(breaks = breaks)
    

提交回复
热议问题