问题
I don't know why my plot looks like this:
I only want to display lines with no fill. Code below. Note this also happens if I run in Spyder or cmd.
import matplotlib.pyplot as plt
import seaborn as sns
df_ard= pd.read_csv(pathx, parse_dates=['Date'] )
plt.figure(figsize=(15,8))
sns.lineplot(x="Date", y='As',
hue="Location",
data=df_ard,
palette='bright')
回答1:
This is an educated guess, since you don't provide your data (see Minimal, Complete, and Verifiable example), but I believe the shading comes from the fact that you have several y-values for the same x-value.
If you look at the documentation for sns.lineplot(), you'll read:
By default, the plot aggregates over multiple y values at each value of x and shows an estimate of the central tendency and a confidence interval for that estimate.
There are several options to remove the shading:
- if you want to continue aggregating the data, but remove the shading, use
ci=None - if you want to not aggregate the data, then use
estimator=None
来源:https://stackoverflow.com/questions/53532529/why-has-seaborn-matplotlib-filled-below-the-line-in-this-lineplot-in-my-jupyter