I'm trying to create a histogram using ListPlot
using the Filling->Axis
and FillingStyle -> {{LightGray, Thickness[.1]}}
as options. However, when I use this the columns are actually higher than the value in the lists. Below is an example
n = 6;
p = 0.5;
(*calculate probabilities *)
list = Table[
c = Binomial[n, k];
d = p^k (1 - p)^(n - k);
{k, c* d}, {k, 0, n}]
(*FillingStyle Thickness results in additional height being added to \
top of each column*)
ListPlot[(list),
Joined -> False,
Axes -> True,
FrameTicks -> {Table[i, {i, 0 , n, 1}],
Table[i, {i, 0, 0.3, 0.05}]},
FrameLabel -> {"Successes k", "Probability"},
Frame -> {True, True, False, False},
PlotStyle -> Automatic,
Filling -> Axis,
FillingStyle -> {{LightGray, Thickness[.1]}},
ImageSize -> 6*72 ]
Does anyone have a suggestion for a solution for this problem while still using ListPlot
?
Thanks,
Mike