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

Skip to content

Commit 0388083

Browse files
update-pie-textprops (with PEPper)
1 parent 1bbf599 commit 0388083

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,10 +2749,10 @@ def get_next_color():
27492749
if rotatelabels:
27502750
label_alignment_v = yt > 0 and 'bottom' or 'top'
27512751
label_rotation = np.rad2deg(thetam) + (0 if xt > 0 else 180)
2752-
props = dict(horizontalalignment = label_alignment_h,
2753-
verticalalignment = label_alignment_v,
2754-
rotation = label_rotation,
2755-
size = rcParams['xtick.labelsize'])
2752+
props = dict(horizontalalignment=label_alignment_h,
2753+
verticalalignment=label_alignment_v,
2754+
rotation=label_rotation,
2755+
size=rcParams['xtick.labelsize'])
27562756
props.update(textprops)
27572757

27582758
t = self.text(xt, yt, label, **props)

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4667,8 +4667,8 @@ def test_pie_rotatelabels_true():
46674667

46684668

46694669
def test_pie_textprops():
4670-
data = [23,34,45]
4671-
labels=["Long name 1", "Long name 2", "Long name 3"]
4670+
data = [23, 34, 45]
4671+
labels = ["Long name 1", "Long name 2", "Long name 3"]
46724672

46734673
textprops = dict(horizontalalignment="center",
46744674
verticalalignment="top",
@@ -4678,7 +4678,7 @@ def test_pie_textprops():
46784678

46794679
_, texts, autopct = plt.gca().pie(data, labels=labels, autopct='%.2f',
46804680
textprops=textprops)
4681-
for labels in [texts,autopct]:
4681+
for labels in [texts, autopct]:
46824682
for tx in labels:
46834683
assert tx.get_ha() == textprops["horizontalalignment"]
46844684
assert tx.get_va() == textprops["verticalalignment"]

0 commit comments

Comments
 (0)