Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bfca5f commit 6029e32Copy full SHA for 6029e32
lib/matplotlib/tests/test_axes.py
@@ -4673,7 +4673,13 @@ def test_hist_emptydata():
4673
4674
4675
def test_hist_none_patch():
4676
- plt.hist([1, 2], label=["First", "Second"])
+ # To cover None patches when excess labels are provided
4677
+ labels = ["First", "Second"]
4678
+ patches = [[1, 2]]
4679
+ fig, ax = plt.subplots()
4680
+ ax.hist(patches, label=labels)
4681
+ _, lbls = ax.get_legend_handles_labels()
4682
+ assert (len(lbls) < len(labels) and len(patches) < len(labels))
4683
4684
4685
def test_hist_labels():
0 commit comments