我有一个 kdeplot,但我正在努力弄清楚如何创建图例。
import matplotlib.patches as mpatches # see the tutorial for how we use mpatches to generate this figure!
# Set 'is_workingday' to a boolean array that is true for all working_days
is_workingday = daily_counts["workingday"] == "yes"
is_not_workingday = daily_counts['workingday'] == "no"
# Bivariate KDEs require two data inputs.
# In this case, we will need the daily counts for casual and registered riders on workdays
casual_workday = daily_counts.loc[is_workingday, 'casual']
registered_workday = daily_counts.loc[is_workingday, 'registered']
# Use sns.kdeplot on the two …Run Code Online (Sandbox Code Playgroud)