@@ -702,15 +702,27 @@ def plot_group(group, ax):
702
702
return fig
703
703
704
704
705
- def hist_frame (data , grid = True , ** kwds ):
705
+ def hist_frame (data , grid = True , xlabelsize = None , xrot = None ,
706
+ ylabelsize = None , yrot = None , ** kwds ):
706
707
"""
707
708
Draw Histogram the DataFrame's series using matplotlib / pylab.
708
709
709
710
Parameters
710
711
----------
712
+ grid : boolean, default True
713
+ Whether to show axis grid lines
714
+ xlabelsize : int, default None
715
+ If specified changes the x-axis label size
716
+ xrot : float, default None
717
+ rotation of x axis labels
718
+ ylabelsize : int, default None
719
+ If specified changes the y-axis label size
720
+ yrot : float, default None
721
+ rotation of y axis labels
711
722
kwds : other plotting keyword arguments
712
723
To be passed to hist function
713
724
"""
725
+ import matplotlib .pyplot as plt
714
726
n = len (data .columns )
715
727
k = 1
716
728
while k ** 2 < n :
@@ -723,17 +735,36 @@ def hist_frame(data, grid=True, **kwds):
723
735
ax .set_title (col )
724
736
ax .grid (grid )
725
737
726
- return axes
738
+ if xlabelsize is not None :
739
+ plt .setp (ax .get_xticklabels (), fontsize = xlabelsize )
740
+ if xrot is not None :
741
+ plt .setp (ax .get_xticklabels (), rotation = xrot )
742
+ if ylabelsize is not None :
743
+ plt .setp (ax .get_yticklabels (), fontsize = ylabelsize )
744
+ if yrot is not None :
745
+ plt .setp (ax .get_yticklabels (), rotation = yrot )
727
746
747
+ return axes
728
748
729
- def hist_series (self , ax = None , grid = True , ** kwds ):
749
+ def hist_series (self , ax = None , grid = True , xlabelsize = None , xrot = None ,
750
+ ylabelsize = None , yrot = None , ** kwds ):
730
751
"""
731
752
Draw histogram of the input series using matplotlib
732
753
733
754
Parameters
734
755
----------
735
756
ax : matplotlib axis object
736
757
If not passed, uses gca()
758
+ grid : boolean, default True
759
+ Whether to show axis grid lines
760
+ xlabelsize : int, default None
761
+ If specified changes the x-axis label size
762
+ xrot : float, default None
763
+ rotation of x axis labels
764
+ ylabelsize : int, default None
765
+ If specified changes the y-axis label size
766
+ yrot : float, default None
767
+ rotation of y axis labels
737
768
kwds : keywords
738
769
To be passed to the actual plotting function
739
770
@@ -752,6 +783,15 @@ def hist_series(self, ax=None, grid=True, **kwds):
752
783
ax .hist (values , ** kwds )
753
784
ax .grid (grid )
754
785
786
+ if xlabelsize is not None :
787
+ plt .setp (ax .get_xticklabels (), fontsize = xlabelsize )
788
+ if xrot is not None :
789
+ plt .setp (ax .get_xticklabels (), rotation = xrot )
790
+ if ylabelsize is not None :
791
+ plt .setp (ax .get_yticklabels (), fontsize = ylabelsize )
792
+ if yrot is not None :
793
+ plt .setp (ax .get_yticklabels (), rotation = yrot )
794
+
755
795
return ax
756
796
757
797
0 commit comments