File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2995,6 +2995,23 @@ def test_secondary_axis_font_size(self, method):
2995
2995
self ._check_ticks_props (axes = ax .right_ax ,
2996
2996
ylabelsize = fontsize )
2997
2997
2998
+ @pytest .mark .slow
2999
+ def test_x_string_values_ticks (self ):
3000
+ # GH: 7612
3001
+ # GH: 22334
3002
+ # GH: 15912
3003
+ df = pd .DataFrame ({'sales' : [3 , 2 , 3 ],
3004
+ 'visits' : [20 , 42 , 28 ],
3005
+ 'day' : ['Monday' , 'Tuesday' , 'Wednesday' ]})
3006
+ ax = df .plot .area (x = 'day' )
3007
+ ax .set_xlim (- 1 , 3 )
3008
+ xticklabels = [t .get_text () for t in ax .get_xticklabels ()]
3009
+ labels_position = dict (zip (xticklabels , ax .get_xticks ()))
3010
+ # Testing if the label stayed at the right position
3011
+ assert labels_position ['Monday' ] == 0.0
3012
+ assert labels_position ['Tuesday' ] == 1.0
3013
+ assert labels_position ['Wednesday' ] == 2.0
3014
+
2998
3015
2999
3016
def _generate_4_axes_via_gridspec ():
3000
3017
import matplotlib .pyplot as plt
You can’t perform that action at this time.
0 commit comments