android 对数标度 图库,构建hist和boxplot的对数标度

I need your help because I want to have a logarithmic scale for my histogram and boxplot. The problem is that I have many observation which are concentrate in a little interval, and I think using logarithmic scale will solve my issue. For example,

我需要你的帮助,因为我希望我的直方图和箱形图有一个对数刻度。问题是我有很多观察集中在一个小间隔,我认为使用对数标度将解决我的问题。例如,

x

y

z

par(mfrow=c(1,2))

hist(z, main="Histogramme des durées",

ylab="Fréquences")

boxplot(z, main="Boîtes des durées")

par(mfrow=c(1,1))

It's very difficult to analyze my data, so I tried to add log = "x" but it don't do what I want !

分析我的数据非常困难,所以我尝试添加log =“x”,但它没有做我想要的!

Thank you in advance.

先谢谢你。

1 个解决方案

#1

1

Instead of scaling the plot axis, you could plot the logarithm of the data.

您可以绘制数据的对数,而不是缩放绘图轴。

par(mfrow=c(1,2))

hist(log(z), main="Histogramme des durées",ylab="Fréquences")

boxplot(log(z), main="Boîtes des durées")

If you want the axis scale to be in the original units (not logarithmic units), you can change the axis tick labels.

如果希望轴刻度为原始单位(不是对数单位),则可以更改轴刻度标签。

par(mfrow=c(1,2))

hist(log10(z), xaxt='n',xlab='',main="Histogramme des durées",ylab="Fréquences")

atx

labels

as.expression(bquote(10^.(i) ))

)

axis(1,at=atx,labels=labels)

boxplot(log10(z),yaxt='n', ylab='z',main="Boîtes des durées")

aty

labels

as.expression(bquote(10^.(i) ))

)

axis(2,at=aty,labels=labels)

707ab9c5901a4ae73399ab5ecfb33ca4.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值