我有以下数字:
由以下代码生成:
def graph(seconds,now, dayold, threedayold,weekold):
dis=4*24*60*60
x = np.array(seconds[-dis:])
ynow = np.array(now)
yday = np.array(dayold)
y3day = np.array(threedayold)
yweek = np.array(weekold)
plt.plot(x,ynow, 'blue')
plt.plot(x,yday, 'green')
plt.plot(x,y3day,'purple')
plt.plot(x,yweek, 'red')
# plt.fill_between(x,ynow,yday,color='lightblue')
# plt.fill_between(x,yday,y3day,color='green')
# plt.fill_between(x,y3day,yweek,color='purple')
# plt.fill_between(x,yweek,[0] *len(seconds),color='red')
currenttime=int(seconds[0])
lastweek=myround(currenttime-7*24*3600)
plt.xlim(lastweek, currenttime)
plt.ylim(ymax=100)
ticks=np.arange(lastweek,currenttime,24*3600)
labels=[time.strftime("%a", time.gmtime(x)) for x in ticks]
plt.xticks(ticks,labels)
plt.grid()
plt.savefig('/home/joereddington/joereddington.com/stress/stress.png')
但我想要的是一个更像这样的数字:
在我的本地计算机上,当前被注释掉的行可以实现这一点,但是,当我在服务器上尝试它们时,我得到:
^{pr2}$我做错什么了。。。更重要的是,我该如何修复它?在
传入的数据既不是numpy数组也不是列表,调用
np.array
无法将原始数据转换为numpy
数组。在举个例子,试试看
打印
array(set(['aa', 1, 2, 3]), dtype=object)
相关问题 更多 >
编程相关推荐