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

Skip to content

Commit dfeeb53

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

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,13 +3716,10 @@ def get_next_color():
37163716

37173717
if labels is not None and labeldistance is not None:
37183718
# Add labels to the wedges.
3719-
default_size = {'fontsize': mpl.rcParams['xtick.labelsize']}
3720-
if textprops is None:
3721-
labels_textprops = default_size
3722-
elif 'fontsize' in textprops or 'size' in textprops:
3723-
labels_textprops = textprops
3724-
else:
3725-
labels_textprops = textprops | default_size
3719+
labels_textprops = {
3720+
'fontsize': mpl.rcParams['xtick.labelsize'],
3721+
**cbook.normalize_kwargs(text_props or {}, Text)
3722+
}
37263723
self.pie_label(pc, labels, distance=labeldistance,
37273724
alignment='outer', rotate=rotatelabels,
37283725
textprops=labels_textprops)

lib/matplotlib/container.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ def __init__(self, patches, values, normalize):
184184

185185
@property
186186
def values(self):
187-
return tuple(self._values)
187+
result = self._values.copy()
188+
result.flags.writable = False
189+
return result
188190

189191
@property
190192
def fracs(self):

0 commit comments

Comments
 (0)