【发布时间】:2013-03-27 22:43:04
【问题描述】:
假设我有以下内容:
[1,5,1,1,6,3,3,4,5,5,5,2,5]
计数: 1-3 2-1 3-2 4-1 5-5 6-1
现在,我想打印一个在 x 轴上排序的直方图,如下所示:
不是:1 2 3 4 5 6
但按总数排序:2 4 6 3 1 5。
请帮帮我!谢谢...
我当前的绘图代码是:
plt.clf()
plt.cla()
plt.xlim(0,1)
plt.axvline(x=.85, color='r',linewidth=0.1)
plt.hist(correlation,2000,(0.0,1.0))
plt.xlabel(index[thecolumn]+' histogram')
plt.ylabel('X Data')
savefig(histogramsave,format='pdf')
【问题讨论】:
-
您是如何尝试做到这一点的,哪里出了问题?发布您当前的代码,人们将能够提供帮助 - 事实上,我们将不得不编写整个事情。
-
plt.clf() plt.cla() plt.xlim(0,1) plt.axvline(x=.85, color='r',linewidth=0.1) plt.hist(correlation ,2000,(0.0,1.0)) plt.xlabel(index[thecolumn]+' histogram') plt.ylabel('Value') savefig(histogramsave,format='pdf')
-
最好将其编辑到您的问题中,以便阅读。
-
哦,对不起!抱歉!
标签: python sorting matplotlib histogram