@@ -401,22 +401,8 @@ def _add_table(self):
401
401
402
402
def _post_plot_logic_common (self , ax , data ):
403
403
"""Common post process for each axes"""
404
- from matplotlib .ticker import FixedLocator , FixedFormatter
405
-
406
- def get_label (i ):
407
- try :
408
- return pprint_thing (data .index [i ])
409
- except Exception :
410
- return ''
411
404
412
405
if self .orientation == 'vertical' or self .orientation is None :
413
- if self ._need_to_set_index :
414
- xticks = ax .get_xticks ()
415
- xticklabels = [get_label (x ) for x in xticks ]
416
- ax .set_xticklabels (xticklabels )
417
- ax .xaxis .set_major_locator (FixedLocator (xticks ))
418
- ax .xaxis .set_major_formatter (FixedFormatter (xticklabels ))
419
-
420
406
self ._apply_axis_properties (ax .xaxis , rot = self .rot ,
421
407
fontsize = self .fontsize )
422
408
self ._apply_axis_properties (ax .yaxis , fontsize = self .fontsize )
@@ -426,12 +412,6 @@ def get_label(i):
426
412
fontsize = self .fontsize )
427
413
428
414
elif self .orientation == 'horizontal' :
429
- if self ._need_to_set_index :
430
- yticks = ax .get_yticks ()
431
- yticklabels = [get_label (y ) for y in yticks ]
432
- ax .set_yticklabels (yticklabels )
433
- ax .xaxis .set_major_locator (FixedLocator (yticks ))
434
- ax .xaxis .set_major_formatter (FixedFormatter (yticklabels ))
435
415
self ._apply_axis_properties (ax .yaxis , rot = self .rot ,
436
416
fontsize = self .fontsize )
437
417
self ._apply_axis_properties (ax .xaxis , fontsize = self .fontsize )
@@ -1115,6 +1095,20 @@ def _update_stacker(cls, ax, stacking_id, values):
1115
1095
ax ._stacker_neg_prior [stacking_id ] += values
1116
1096
1117
1097
def _post_plot_logic (self , ax , data ):
1098
+ from matplotlib .ticker import FixedLocator
1099
+
1100
+ def get_label (i ):
1101
+ try :
1102
+ return pprint_thing (data .index [i ])
1103
+ except Exception :
1104
+ return ''
1105
+
1106
+ if self ._need_to_set_index :
1107
+ xticks = ax .get_xticks ()
1108
+ xticklabels = [get_label (x ) for x in xticks ]
1109
+ ax .set_xticklabels (xticklabels )
1110
+ ax .xaxis .set_major_locator (FixedLocator (xticks ))
1111
+
1118
1112
condition = (not self ._use_dynamic_x () and
1119
1113
data .index .is_all_dates and
1120
1114
not self .subplots or
0 commit comments