简体   繁体   中英

Seaborn lineplot not plotting till the maximum value

I'm trying to plot a dataframe with x-axis as the month and y-axis as the transaction amount. The amount column has a maximum value of around 8,000.

As there are around 12,000 records, there are multiple transactions on each day.

The code

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()

Checking maximum value of amount in the dataframe

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

Output: 8835.98

This is the plot I got with seaborn lineplot.

在此处输入图像描述

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.

What do these two forms of plots on the single plot indicate?

Seaborn's lineplot by definition does not plot the maximum value. The value itself is aggregation of all y-values in the same x-value (eg mean). I guess you are asking about the "brighter" area around the line.

It's called confidence interval. It has a mathematical definition and a way to compute it. It's not the maximal and minimal value. Therefore it should not plot the maximal value anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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