Я застрял на чем-то, что кажется, должно быть относительно легко. Код, который я привожу ниже, является примером, основанным на более крупном проекте, над которым я работаю. Я не видел причин публиковать все детали, поэтому, пожалуйста, примите структуры данных, которые я привел как есть.
По сути, я создаю гистограмму и просто могу понять, как добавить метки значений на столбцы (в центре столбца или чуть выше него). Я просматривал примеры в Интернете, но безуспешно реализовывал свой собственный код. Я полагаю, что решение заключается либо в "тексте", либо в "аннотации", но я: а) не знаю, какой использовать (и вообще говоря, не определился, когда и какой использовать). б) не вижу, чтобы получить либо представить метки значения. Буду признателен за вашу помощь, мой код ниже. Заранее спасибо!
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
pd.set_option('display.mpl_style', 'default')
%matplotlib inline
# Bring some raw data.
frequencies = [6, 16, 75, 160, 244, 260, 145, 73, 16, 4, 1]
# In my original code I create a series and run on that,
# so for consistency I create a series from the list.
freq_series = pd.Series.from_array(frequencies)
x_labels = [108300.0, 110540.0, 112780.0, 115020.0, 117260.0, 119500.0,
121740.0, 123980.0, 126220.0, 128460.0, 130700.0]
# Plot the figure.
plt.figure(figsize=(12, 8))
fig = freq_series.plot(kind='bar')
fig.set_title('Amount Frequency')
fig.set_xlabel('Amount ($)')
fig.set_ylabel('Frequency')
fig.set_xticklabels(x_labels)