Following is the code that doesn't work.
import numpy as np
import pandas as pd
import seaborn as sns
sns.displot(pd.DataFrame(res), color='red', edgecolor=None, binwidth=.5, binrange=(3, 18+1));
res
is a list type.
I was expecting the bars to be red, but they are the default color.
I had no problem before with this code.
data=
is specified, and ifx=
, ory=
, is specified.g = sns.histplot(data=df, color='r', legend=False)
, as shown in this plot.histplot
.kde=True
.python 3.11.3
,matplotlib 3.7.1
,seaborn 0.12.2
Imports and Data
Plot Implementation
df
, and do not specify a column name forx=
, requires passing adict
or alist
topalette
.palette
will also accept a string, but the string must be a valid palette name,ValueError: 'r' is not a valid palette name
palette
, compared tocolor
, so passalpha=
(number 0 - 1) to adjust as needed.df
, and specify a column name forx=
x=
res
directly todata=
res
directly tox=