Histogram with Logarithmic Scale and custom breaks

后端 未结 7 1881
谎友^
谎友^ 2020-11-27 16:33

I\'m trying to generate a histogram in R with a logarithmic scale for y. Currently I do:

hist(mydata$V3, breaks=c(0,1,2,3,4,5,25))

This giv

7条回答
  •  暖寄归人
    2020-11-27 16:59

    It's not entirely clear from your question whether you want a logged x-axis or a logged y-axis. A logged y-axis is not a good idea when using bars because they are anchored at zero, which becomes negative infinity when logged. You can work around this problem by using a frequency polygon or density plot.

提交回复
热议问题