Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7417870

Browse files
rcomertimhoffm
andauthored
Apply suggestions from code review
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 26c43e8 commit 7417870

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3755,7 +3755,7 @@ def get_next_color():
37553755

37563756
return pc
37573757

3758-
def pie_label(self, container, labels, *, distance=0.6,
3758+
def pie_label(self, container, /, labels, *, distance=0.6,
37593759
textprops=None, rotate=False, alignment='auto'):
37603760
"""
37613761
Label a pie chart.
@@ -3825,7 +3825,8 @@ def pie_label(self, container, labels, *, distance=0.6,
38253825
# escape % (i.e. \%) if it is not already escaped
38263826
labels = [re.sub(r"([^\\])%", r"\1\\%", s) for s in labels]
38273827
elif (nw := len(container.wedges)) != (nl := len(labels)):
3828-
raise ValueError(f'Found {nw} wedges but {nl} labels')
3828+
raise ValueError(
3829+
f'The number of labels ({nl}) must match the number of wedges ({nw})')
38293830

38303831
texts = []
38313832

lib/matplotlib/container.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ class PieContainer:
154154
155155
.. versionadded:: 3.11
156156
157-
The ``PieContainer`` name is provisional and may change in future to reflect
158-
development of its functionality.
157+
.. warning::
158+
The class name ``PieContainer`` name is provisional and may change in future
159+
to reflect development of its functionality.
159160
160161
You can access the wedge patches and further parameters by the attributes.
161162

0 commit comments

Comments
 (0)