histPlotSeaborn Flashcards
What parameter controls the number of bins in a Seaborn histogram?
The bins
parameter sets the number of bins or bin edges (e.g., bins=30
).
How do you add a Kernel Density Estimate (KDE) to a histogram?
Set kde=True
to overlay a KDE curve.
How do you create a stacked histogram for grouped data?
Use multiple='stack'
with hue
to stack groups.
How do you normalize a histogram to show probabilities?
Set stat='probability'
to normalize the histogram.
What does the hue
parameter do in a histogram?
The hue
parameter splits the data into subgroups based on a categorical variable.
How do you log-scale the x-axis in a histogram?
Use log_scale=True
or log_scale=(True, False)
for x/y scaling.
What is the default stat
value in a histogram?
The default is stat='count'
, which shows raw frequencies.
How do you dodge grouped histograms instead of stacking them?
Set multiple='dodge'
to place groups side by side.
How do you customize histogram colors?
Use color
for single-color histograms or palette
for hue
groups.
How do you create a horizontal histogram?
Assign the variable to y
instead of x
(e.g., y='total_bill'
).