繁体   English   中英

Seaborn 线图直到最大值才绘制

[英]Seaborn lineplot not plotting till the maximum value

我正在尝试 plot 和 dataframe ,其中 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()

检查 dataframe 中金额的最大值

df_time[df_time['movement']=='credit'].amount.max()

Output: 8835.98

这是我用 seaborn 线图得到的 plot。

在此处输入图像描述

The thing that I'm confused with is that the plot should go up-to around 8,000 as that is the maximum transaction value in my dataframe but instead it only goes upto 4,000 and gives me a solid plot as well as a shaded region.

单个 plot 上的这两个 forms 的图表示什么?

Seaborn 的线图按定义没有 plot 的最大值。 该值本身是所有 y 值在同一 x 值(例如平均值)中的聚合。 我猜您是在询问线路周围的“较亮”区域。

这称为置信区间。 它有一个数学定义和一种计算方法。 这不是最大值和最小值。 因此无论如何它不应该是最大值 plot

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM