我有几个数据集(分布)如下:
set1 = [1,2,3,4,5]
set2 = [3,4,5,6,7]
set3 = [1,3,4,5,8]
如何绘制散点图,其中y轴为概率(即集合中分布的百分位数:0%-100%),x轴为数据集名称? 在JMP中,它被称为“分位数图”。
类似于附加图像的内容:
请教育。谢谢。
[编辑]
我的数据是csv格式的:
使用JMP分析工具,我可以绘制概率分布图(QQ图/正态分位数图如下图所示):
我相信Joe Kington几乎解决了我的问题,但是,我想知道如何将原始csv数据处理成概率或百分位数数组。
我这样做是为了在Python中自动执行一些统计分析,而不是依赖JMP进行绘图。
我不太清楚你想要什么,所以我猜,这里。。。
你希望“概率/百分位数”值是累积直方图吗?
所以对于一个情节,你会有这样的东西?(使用上面显示的标记绘制,而不是更传统的阶梯图…)
如果这基本上就是你想要的一个图形,那么有多种方法可以在一个图形上绘制多个图形。最简单的方法就是使用子块。
在这里,我们将生成一些数据集,并将它们绘制在具有不同符号的不同子块上。。。
如果我们想让它看起来像一个连续的图,我们可以把子图挤在一起,关闭一些边界。只需在调用
plt.show()
之前添加以下内容希望这能有点帮助,无论如何!
编辑:如果你想要百分位值,可以用累积直方图(我真的不应该用100作为样本大小!),很容易做到。
就做这样的事情(使用
numpy.percentile
而不是手工规范化):相关问题 更多 >
编程相关推荐