Python Matplotlib直方图和列表

Python Matplotlib直方图和列表,python,matplotlib,histogram,Python,Matplotlib,Histogram,我的问题很简单 我有一份时间和数字的清单 listTimes = [2103, 2103, 2104, 2104, 2104, 2105, 2106, 2107, 2108, 2108] listNumbers = [2, 2, 7, 4, 7, 4, 5, 5, 5] 我想做一个柱状图,显示在21:03,数字2出现了两次。 同样的柱状图应该显示在21:04,数字4出现一次,数字7出现两次 这可能吗 再见。您需要的是一个绘图: 你的意思是让listTimes和listNumbers长度相同吗?

我的问题很简单

我有一份时间和数字的清单

listTimes = [2103, 2103, 2104, 2104, 2104, 2105, 2106, 2107, 2108, 2108]
listNumbers = [2, 2, 7, 4, 7, 4, 5, 5, 5]
我想做一个柱状图,显示在21:03,数字2出现了两次。 同样的柱状图应该显示在21:04,数字4出现一次,数字7出现两次

这可能吗

再见。

您需要的是一个绘图:


你的意思是让listTimes和listNumbers长度相同吗?你希望listTimes=[2103,2103,2104,2104,2104,2104,2105,2106,2107,2108]和listNumbers=[2,3,7,4,4,5,5]的长度是一样的。@SEClark:是的塞德里克H:当我用plt.bar绘制它时,它只会在某个特定的时间给我提供最高的数字。我回家后会试试这个。谢谢
plt.hexbin(listTimes, listNumbers)