Skip to content

Commit f7b833c

Browse files
author
Moritz Schreiber
committed
make changes minimal
1 parent 05a26c8 commit f7b833c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

pandas/tests/plotting/frame/test_frame.py

-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ def test_plot_bar(self):
831831
_check_plot_works(df.plot.bar)
832832

833833
df = DataFrame({"a": [0, 1], "b": [1, 0]})
834-
835834
ax = _check_plot_works(df.plot.bar)
836835
self._check_ticks_props(ax, xrot=90)
837836

pandas/tests/plotting/frame/test_frame_color.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_bar_colors(self):
119119
tm.close()
120120

121121
custom_colors = "rgcby"
122-
ax = df.plot.bar(color="rgcby")
122+
ax = df.plot.bar(color=custom_colors)
123123
self._check_colors(ax.patches[::5], facecolors=custom_colors)
124124
tm.close()
125125

@@ -151,14 +151,14 @@ def test_bar_user_colors(self):
151151
)
152152
# This should *only* work when `y` is specified, else
153153
# we use one color per column
154+
ax = df.plot.bar(y="A", color=df["color"])
155+
result = [p.get_facecolor() for p in ax.patches]
154156
expected = [
155157
(1.0, 0.0, 0.0, 1.0),
156158
(0.0, 0.0, 1.0, 1.0),
157159
(0.0, 0.0, 1.0, 1.0),
158160
(1.0, 0.0, 0.0, 1.0),
159161
]
160-
ax = df.plot.bar(y="A", color=df["color"])
161-
result = [p.get_facecolor() for p in ax.patches]
162162
assert result == expected
163163

164164
def test_if_scatterplot_colorbar_affects_xaxis_visibility(self):

pandas/tests/plotting/test_series.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,14 @@ def test_bar_ignore_index(self):
270270

271271
def test_bar_user_colors(self):
272272
s = Series([1, 2, 3, 4])
273-
273+
ax = s.plot.bar(color=["red", "blue", "blue", "red"])
274+
result = [p.get_facecolor() for p in ax.patches]
274275
expected = [
275276
(1.0, 0.0, 0.0, 1.0),
276277
(0.0, 0.0, 1.0, 1.0),
277278
(0.0, 0.0, 1.0, 1.0),
278279
(1.0, 0.0, 0.0, 1.0),
279280
]
280-
281-
ax = s.plot.bar(color=["red", "blue", "blue", "red"])
282-
result = [p.get_facecolor() for p in ax.patches]
283281
assert result == expected
284282

285283
def test_rotation(self):

0 commit comments

Comments
 (0)