2

I'm familiar with the matplotlib histogram reference:

http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.hist

However, I don't actually have the original series/data to pass into the plot. I have only the summary statistics in a DataFrame. Example:

df

lower  upper  occurrences  frequency
0.0    0.5    17           .111
0.5    0.1    65           .426
0.1    1.5    147          .963
1.5    2.0    210          1.376
.
.
.
M--
  • 25,431
  • 8
  • 61
  • 93
mk8efz
  • 1,374
  • 4
  • 20
  • 36

1 Answers1

3

You don't want to calculate a histogram here, because you already have the histogrammed data. Therefore you may simply plot a bar chart.

fig, ax = plt.subplots()
ax.bar(df.lower, df.occurences, width=df.upper-df.lower, ec="k", align="edge")
ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712