@@ -1030,6 +1030,35 @@ def test_plot_scatter(self):
1030
1030
axes = df .plot (x = 'x' , y = 'y' , kind = 'scatter' , subplots = True )
1031
1031
self ._check_axes_shape (axes , axes_num = 1 , layout = (1 , 1 ))
1032
1032
1033
+ @pytest .mark .slow
1034
+ def test_if_scatterplot_colorbar_affects_xaxis_visibility (self ):
1035
+ random_array = np .random .random ((1000 ,3 ))
1036
+ df = pd .DataFrame (random_array ,columns = ['A label' ,'B label' ,'C label' ])
1037
+
1038
+ ax1 = df .plot .scatter (x = 'A label' , y = 'B label' )
1039
+ ax2 = df .plot .scatter (x = 'A label' , y = 'B label' , c = 'C label' )
1040
+
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'
1049
+
1050
+ @pytest .mark .slow
1051
+ def test_if_hexbin_xaxis_label_is_visible (self ):
1052
+ random_array = np .random .random ((1000 ,3 ))
1053
+ df = pd .DataFrame (random_array ,columns = ['A label' ,'B label' ,'C label' ])
1054
+
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'
1061
+
1033
1062
@pytest .mark .slow
1034
1063
def test_plot_scatter_with_categorical_data (self ):
1035
1064
# GH 16199
0 commit comments