@@ -1409,7 +1409,7 @@ def orientation(self):
1409
1409
1410
1410
Returns
1411
1411
-------
1412
- axes : matplotlib.AxesSubplot or np.array of them
1412
+ axes : matplotlib.axes.Axes or numpy.ndarray of them
1413
1413
1414
1414
See Also
1415
1415
--------
@@ -1917,7 +1917,7 @@ def _plot(data, x=None, y=None, subplots=False,
1917
1917
1918
1918
Returns
1919
1919
-------
1920
- axes : matplotlib.AxesSubplot or np.array of them
1920
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
1921
1921
1922
1922
Notes
1923
1923
-----
@@ -2581,7 +2581,7 @@ def line(self, **kwds):
2581
2581
2582
2582
Returns
2583
2583
-------
2584
- axes : matplotlib.AxesSubplot or np.array of them
2584
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2585
2585
2586
2586
Examples
2587
2587
--------
@@ -2606,7 +2606,7 @@ def bar(self, **kwds):
2606
2606
2607
2607
Returns
2608
2608
-------
2609
- axes : matplotlib.AxesSubplot or np.array of them
2609
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2610
2610
"""
2611
2611
return self (kind = 'bar' , ** kwds )
2612
2612
@@ -2622,7 +2622,7 @@ def barh(self, **kwds):
2622
2622
2623
2623
Returns
2624
2624
-------
2625
- axes : matplotlib.AxesSubplot or np.array of them
2625
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2626
2626
"""
2627
2627
return self (kind = 'barh' , ** kwds )
2628
2628
@@ -2638,7 +2638,7 @@ def box(self, **kwds):
2638
2638
2639
2639
Returns
2640
2640
-------
2641
- axes : matplotlib.AxesSubplot or np.array of them
2641
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2642
2642
"""
2643
2643
return self (kind = 'box' , ** kwds )
2644
2644
@@ -2656,7 +2656,7 @@ def hist(self, bins=10, **kwds):
2656
2656
2657
2657
Returns
2658
2658
-------
2659
- axes : matplotlib.AxesSubplot or np.array of them
2659
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2660
2660
"""
2661
2661
return self (kind = 'hist' , bins = bins , ** kwds )
2662
2662
@@ -2715,7 +2715,7 @@ def area(self, **kwds):
2715
2715
2716
2716
Returns
2717
2717
-------
2718
- axes : matplotlib.AxesSubplot or np.array of them
2718
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2719
2719
"""
2720
2720
return self (kind = 'area' , ** kwds )
2721
2721
@@ -2731,7 +2731,7 @@ def pie(self, **kwds):
2731
2731
2732
2732
Returns
2733
2733
-------
2734
- axes : matplotlib.AxesSubplot or np.array of them
2734
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2735
2735
"""
2736
2736
return self (kind = 'pie' , ** kwds )
2737
2737
@@ -2783,7 +2783,7 @@ def line(self, x=None, y=None, **kwds):
2783
2783
2784
2784
Returns
2785
2785
-------
2786
- axes : matplotlib.AxesSubplot or np.array of them
2786
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2787
2787
"""
2788
2788
return self (kind = 'line' , x = x , y = y , ** kwds )
2789
2789
@@ -2801,25 +2801,87 @@ def bar(self, x=None, y=None, **kwds):
2801
2801
2802
2802
Returns
2803
2803
-------
2804
- axes : matplotlib.AxesSubplot or np.array of them
2804
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2805
2805
"""
2806
2806
return self (kind = 'bar' , x = x , y = y , ** kwds )
2807
2807
2808
2808
def barh (self , x = None , y = None , ** kwds ):
2809
2809
"""
2810
- Horizontal bar plot
2810
+ Make a horizontal bar plot.
2811
+
2812
+ A horizontal bar plot is a plot that presents quantitative data with
2813
+ rectangular bars with lengths proportional to the values that they
2814
+ represent. A bar plot shows comparisons among discrete categories. One
2815
+ axis of the plot shows the specific categories being compared, and the
2816
+ other axis represents a measured value.
2811
2817
2812
2818
Parameters
2813
2819
----------
2814
- x, y : label or position, optional
2815
- Coordinates for each point.
2816
- `**kwds` : optional
2817
- Additional keyword arguments are documented in
2818
- :meth:`pandas.DataFrame.plot`.
2820
+ x : label or position, default DataFrame.index
2821
+ Column to be used for categories.
2822
+ y : label or position, default All numeric columns in dataframe
2823
+ Columns to be plotted from the DataFrame.
2824
+ **kwds
2825
+ Keyword arguments to pass on to :meth:`pandas.DataFrame.plot`.
2819
2826
2820
2827
Returns
2821
2828
-------
2822
- axes : matplotlib.AxesSubplot or np.array of them
2829
+ axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them.
2830
+
2831
+ See Also
2832
+ --------
2833
+ pandas.DataFrame.plot.bar: Vertical bar plot.
2834
+ pandas.DataFrame.plot : Make plots of DataFrame using matplotlib.
2835
+ matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib.
2836
+
2837
+ Examples
2838
+ --------
2839
+ Basic example
2840
+
2841
+ .. plot::
2842
+ :context: close-figs
2843
+
2844
+ >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]})
2845
+ >>> ax = df.plot.barh(x='lab', y='val')
2846
+
2847
+ Plot a whole DataFrame to a horizontal bar plot
2848
+
2849
+ .. plot::
2850
+ :context: close-figs
2851
+
2852
+ >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
2853
+ >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
2854
+ >>> index = ['snail', 'pig', 'elephant',
2855
+ ... 'rabbit', 'giraffe', 'coyote', 'horse']
2856
+ >>> df = pd.DataFrame({'speed': speed,
2857
+ ... 'lifespan': lifespan}, index=index)
2858
+ >>> ax = df.plot.barh()
2859
+
2860
+ Plot a column of the DataFrame to a horizontal bar plot
2861
+
2862
+ .. plot::
2863
+ :context: close-figs
2864
+
2865
+ >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
2866
+ >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
2867
+ >>> index = ['snail', 'pig', 'elephant',
2868
+ ... 'rabbit', 'giraffe', 'coyote', 'horse']
2869
+ >>> df = pd.DataFrame({'speed': speed,
2870
+ ... 'lifespan': lifespan}, index=index)
2871
+ >>> ax = df.plot.barh(y='speed')
2872
+
2873
+ Plot DataFrame versus the desired column
2874
+
2875
+ .. plot::
2876
+ :context: close-figs
2877
+
2878
+ >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
2879
+ >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
2880
+ >>> index = ['snail', 'pig', 'elephant',
2881
+ ... 'rabbit', 'giraffe', 'coyote', 'horse']
2882
+ >>> df = pd.DataFrame({'speed': speed,
2883
+ ... 'lifespan': lifespan}, index=index)
2884
+ >>> ax = df.plot.barh(x='lifespan')
2823
2885
"""
2824
2886
return self (kind = 'barh' , x = x , y = y , ** kwds )
2825
2887
@@ -2837,7 +2899,7 @@ def box(self, by=None, **kwds):
2837
2899
2838
2900
Returns
2839
2901
-------
2840
- axes : matplotlib.AxesSubplot or np.array of them
2902
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2841
2903
"""
2842
2904
return self (kind = 'box' , by = by , ** kwds )
2843
2905
@@ -2857,7 +2919,7 @@ def hist(self, by=None, bins=10, **kwds):
2857
2919
2858
2920
Returns
2859
2921
-------
2860
- axes : matplotlib.AxesSubplot or np.array of them
2922
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2861
2923
"""
2862
2924
return self (kind = 'hist' , by = by , bins = bins , ** kwds )
2863
2925
@@ -2921,7 +2983,7 @@ def area(self, x=None, y=None, **kwds):
2921
2983
2922
2984
Returns
2923
2985
-------
2924
- axes : matplotlib.AxesSubplot or np.array of them
2986
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2925
2987
"""
2926
2988
return self (kind = 'area' , x = x , y = y , ** kwds )
2927
2989
@@ -2939,7 +3001,7 @@ def pie(self, y=None, **kwds):
2939
3001
2940
3002
Returns
2941
3003
-------
2942
- axes : matplotlib.AxesSubplot or np.array of them
3004
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2943
3005
"""
2944
3006
return self (kind = 'pie' , y = y , ** kwds )
2945
3007
@@ -2961,7 +3023,7 @@ def scatter(self, x, y, s=None, c=None, **kwds):
2961
3023
2962
3024
Returns
2963
3025
-------
2964
- axes : matplotlib.AxesSubplot or np.array of them
3026
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2965
3027
"""
2966
3028
return self (kind = 'scatter' , x = x , y = y , c = c , s = s , ** kwds )
2967
3029
@@ -2987,7 +3049,7 @@ def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None,
2987
3049
2988
3050
Returns
2989
3051
-------
2990
- axes : matplotlib.AxesSubplot or np.array of them
3052
+ axes : :class:` matplotlib.axes.Axes` or numpy.ndarray of them
2991
3053
"""
2992
3054
if reduce_C_function is not None :
2993
3055
kwds ['reduce_C_function' ] = reduce_C_function
0 commit comments