【发布时间】:2015-10-06 07:14:46
【问题描述】:
我有一个实验测量数据框。
我可以使用 pandas 轻松绘制数据框中的数据。这是结果。
日期在轴上是均匀分布的,但实际上它们并不是均匀分布的。如何准确表示测量之间的时间?
这是我绘制数据框的代码:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
normal_df= pd.DataFrame(normal, columns = cols, index = rows[2::])
print normal_df
#Write the data frame to an xlsx file
normal_df.to_excel(csv_file[0:-4] + '_Normalized_Survival.xlsx')
avg = normal_df.mean()
errors = normal_df.sem()
avg.plot(marker = 'v',yerr = errors)
plt.title('Mean Survival with Standard Error',fontsize = 20)
plt.xticks(fontsize = 12,rotation = 45)
plt.yticks(fontsize = 12)
plt.xlabel('Time',fontsize = 18)
plt.ylabel('% Survival',fontsize = 18)
plt.xlim([0,6.1])
plt.legend(['Survival'])
plt.show()
【问题讨论】:
标签: python date pandas matplotlib plot