qiskit/releasenotes/notes/0.21/fix_plot_histogram_number-a...

11 lines
398 B
YAML

---
fixes:
- |
Fixed a bug in :func:`~qiskit.visualization.plot_histogram` when the
``number_to_keep`` argument was smaller that the number of keys. The
following code will no longer throw errors and will be properly aligned::
from qiskit.visualization import plot_histogram
data = {'00': 3, '01': 5, '11': 8, '10': 11}
plot_histogram(data, number_to_keep=2)