需要帮助在python中绘制2D数组。我正在使用Spyder(Python 3.6)

时间:2018-07-20 18:56:32

标签: python matlab matplotlib

我的程序的输出是

[[[['AB','CD','EF','GH','AB'],['CD','EF','AB','AB','AB'],[ 'AB','CD','AB','GH','AB']]

AB CD EF GH AB CD EF AB AB AB AB CD AB GH AB

我可以在python中绘制吗? 例如:每行代表时间...我正在使用字符串输出,除了直方图,我可以在python中使用哪些不同类型的图?

谢谢!

请帮助!

1 个答案:

答案 0 :(得分:0)

据我所知,您可能希望绘制每个字符串的频率。为此,如果您的输出是:

output = ['AB', 'CD', 'EF', 'GH', 'AB', 'CD', 'EF', 'AB', 'AB', 'AB', 'AB', 'CD', 'AB', 'GH', 'AB']

然后,您可以只使用hist

import matplotlib.pyplot as plt

plt.hist(output)
plt.xlabel('string')
plt.ylabel('count')

plt.show()

enter image description here

相关问题