python - 为多个元素创建具有均值和标准差的直方图
问题描述
下面的数组由以下结构组成:
大批:
[[[70, 2.23606797749979], [66, 5.477225575051661], [71, 1.4142135623730951], [75, 4.58257569495584], [68, 0.0]], [[78, 5.196152422706632], [69, 2.0], [69, 2.0], [69, 2.0], [69, 2.0]]]
[[[Average, Standard deviation],[Average, Standard deviation]],[ ... ]]] --> Block
我正在尝试生成一个输出,matplotlib
其中图形是具有以下结构的直方图:
1 个带有平均值的条形图,旁边一个带有标准偏差的条形图,按照此顺序直到块结束,由 5 个均值和 5 个标准差组成
我测试了类似的东西:
x = [[Mean], [Standard Deviation]]
colors = ['red', 'lime']
plt.hist(x, n_bins, density=True, histtype='bar', color=colors, label=colors)
注意:具有平均值和标准差的子列表的数量与日期集的大小有关,示例数组由使用此数据的函数生成
Y轴应该在0到100的范围内,不会经常重复值
解决方案
推荐阅读
- java - 在 vert.x 中按顺序减少 Future
- android - 在片段中获取意图
- css - Chart.js 甜甜圈画布填充
- javascript - 在非内联脚本方法中获取内联脚本的脚本元素
- linux - 引导分区快满了:如何清除或扩展它?
- c++ - 从数组中的文件中读取多个浮点数
- c# - 理解/翻译 C# 事件访问器代码(特别是 += 运算符)到 VB
- java - 根据 4 个 JRadioButtons 的组合执行操作
- three.js - 如何在 Three.js 中移动对象(在移动设备上)
- java - 在 SpringBoot 应用程序中下载时 Azure BlobNotFound