Skip to content

Commit b821474

Browse files
authored
Update test_frame.py
changing for PEP8
1 parent f401672 commit b821474

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

pandas/tests/plotting/test_frame.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,34 +1030,42 @@ def test_plot_scatter(self):
10301030
axes = df.plot(x='x', y='y', kind='scatter', subplots=True)
10311031
self._check_axes_shape(axes, axes_num=1, layout=(1, 1))
10321032

1033-
@pytest.mark.slow
1033+
@pytest.mark.slow
10341034
def test_if_scatterplot_colorbar_affects_xaxis_visibility(self):
10351035
random_array = np.random.random((1000,3))
10361036
df = pd.DataFrame(random_array,columns=['A label','B label','C label'])
10371037

10381038
ax1 = df.plot.scatter(x='A label', y='B label')
10391039
ax2 = df.plot.scatter(x='A label', y='B label', c='C label')
10401040

1041-
assert all([vis[0].get_visible()==vis[1].get_visible() for vis in
1042-
zip(ax1.xaxis.get_minorticklabels(),ax2.xaxis.get_minorticklabels())]),\
1043-
'minor x-axis tick labels visibility changes when colorbar included'
1044-
assert all([vis[0].get_visible()==vis[1].get_visible() for vis in
1045-
zip(ax1.xaxis.get_majorticklabels(),ax2.xaxis.get_majorticklabels())]),\
1046-
'major x-axis tick labels visibility changes when colorbar included'
1047-
assert ax1.xaxis.get_label().get_visible()==ax2.xaxis.get_label().get_visible(),\
1048-
'x-axis label visibility changes when colorbar included'
1041+
assert all([vis[0].get_visible() == vis[1].get_visible() for vis in
1042+
zip(ax1.xaxis.get_minorticklabels(),
1043+
ax2.xaxis.get_minorticklabels())]), \
1044+
'minor x-axis tick labels visibility'
1045+
'changes when colorbar included'
1046+
assert all([vis[0].get_visible() == vis[1].get_visible() for vis in
1047+
zip(ax1.xaxis.get_majorticklabels(),
1048+
ax2.xaxis.get_majorticklabels())]), \
1049+
'major x-axis tick labels visibility'
1050+
'changes when colorbar included'
1051+
assert ax1.xaxis.get_label().get_visible() == \
1052+
ax2.xaxis.get_label().get_visible(), \
1053+
'x-axis label visibility changes when colorbar included'
10491054

10501055
@pytest.mark.slow
10511056
def test_if_hexbin_xaxis_label_is_visible(self):
10521057
random_array = np.random.random((1000,3))
10531058
df = pd.DataFrame(random_array,columns=['A label','B label','C label'])
10541059

1055-
ax = df.plot.hexbin('A label','B label', gridsize=12);
1056-
assert all([vis.get_visible() for vis in ax.xaxis.get_minorticklabels()]),\
1057-
'minor x-axis tick labels are not visible'
1058-
assert all([vis.get_visible() for vis in ax.xaxis.get_majorticklabels()]),\
1059-
'major x-axis tick labels are not visible'
1060-
assert ax.xaxis.get_label().get_visible(),'x-axis label is not visible'
1060+
ax = df.plot.hexbin('A label','B label', gridsize=12)
1061+
assert all([vis.get_visible() for vis in
1062+
ax.xaxis.get_minorticklabels()]), \
1063+
'minor x-axis tick labels are not visible'
1064+
assert all([vis.get_visible() for vis in
1065+
ax.xaxis.get_majorticklabels()]), \
1066+
'major x-axis tick labels are not visible'
1067+
assert ax.xaxis.get_label().get_visible(), \
1068+
'x-axis label is not visible'
10611069

10621070
@pytest.mark.slow
10631071
def test_plot_scatter_with_categorical_data(self):

0 commit comments

Comments
 (0)