The histogram (hist) function with multiple data sets
np
.
random
.
seed
(
19680801
)
=
10
=
(
1000
,
3
)
,
((
,
),
(
,
))
=
(
nrows
=
2
,
ncols
=
2
)
=
[
'red'
,
'tan'
,
'lime'
]
(
,
,
density
=
True
,
histtype
=
'bar'
,
color
=
,
label
=
)
(
prop
=
{
'size'
:
10
})
(
'bars with legend'
)
(
,
,
density
=
True
,
histtype
=
'bar'
,
stacked
=
True
)
(
'stacked bar'
)
(
,
,
histtype
=
'step'
,
stacked
=
True
,
fill
=
False
)
(
'stack step (unfilled)'
)
=
[
(
n
)
for
n
in
[
10000
,
5000
,
2000
]]
(
,
,
histtype
=
'bar'
)
(
'different sample sizes'
)
()
()
.
hist
(
,
,
histtype
=
"barstacked"
,
facecolor
=
,
label
=
)
()
(
"Bars with different Facecolors"
)
()
ax
.
hist
(
,
,
histtype
=
"barstacked"
,
hatch
=
,
label
=
)
()
(
"Hatches on Stacked Bars"
)
()
=
[
"green"
,
"red"
,
"blue"
]
(
,
,
fill
=
False
,
histtype
=
"bar"
,
linewidth
=
,
edgecolor
=
,
label
=
)
()
(
"Bars with Linewidths"
)
()
ax
.
hist
(
,
,
fill
=
False
,
histtype
=
'bar'
,
linestyle
=
,
edgecolor
=
,
label
=
)
()
(
'Bars with Linestyles'
)
()
Total running time of the script: (0 minutes 3.845 seconds)