【发布时间】:2020-07-24 21:31:35
【问题描述】:
我正在尝试绘制一个数据框,其中 x 轴作为月份,y 轴作为交易金额。金额列的最大值约为 8,000。
由于大约有 12,000 条记录,因此每天会有多笔交易。
代码
s = sns.FacetGrid(df_time[df_time['movement']=='credit'],row='month',height=5,aspect=1.8)
s.map(sns.lineplot,'day','amount')
s.fig.subplots_adjust(top=0.95)
s.fig.suptitle('Transaction amount(credit) with respect to day and month of the year', fontsize=16)
plt.show()
检查数据框中金额的最大值
df_time[df_time['movement']=='credit'].amount.max()
输出:8835.98
这是我用 seaborn lineplot 得到的情节。
我感到困惑的是,该图应该上升到 8,000 左右,因为这是我的数据框中的最大交易价值,但它只上升到 4,000 并且给了我一个坚实的图和阴影地区。
单图上的这两种形式的图表示什么?
【问题讨论】:
-
请提供您的代码。在没有看到它的情况下帮助您有点困难(以及您的数据样本)
-
用更多信息编辑了问题
标签: python dataframe matplotlib seaborn