@@ -506,7 +506,7 @@ def f(x):
506
506
ax .plot (x , y , color = colors [kls ], label = label , ** kwds )
507
507
else :
508
508
ax .plot (x , y , color = colors [kls ], ** kwds )
509
-
509
+
510
510
ax .legend (loc = 'upper right' )
511
511
ax .grid ()
512
512
return ax
@@ -754,7 +754,7 @@ class MPLPlot(object):
754
754
"""
755
755
_default_rot = 0
756
756
757
- _pop_attributes = ['label' , 'style' , 'logy' , 'logx' , 'loglog' ,
757
+ _pop_attributes = ['label' , 'style' , 'logy' , 'logx' , 'loglog' ,
758
758
'mark_right' ]
759
759
_attr_defaults = {'logy' : False , 'logx' : False , 'loglog' : False ,
760
760
'mark_right' : True }
@@ -1002,8 +1002,8 @@ def _add_table(self):
1002
1002
data = self .data
1003
1003
data = data .transpose ()
1004
1004
else :
1005
- data = self .table
1006
- ax = self ._get_ax (0 )
1005
+ data = self .table
1006
+ ax = self ._get_ax (0 )
1007
1007
table (ax , data )
1008
1008
1009
1009
def _post_plot_logic (self ):
@@ -1545,7 +1545,7 @@ def _is_ts_plot(self):
1545
1545
def _make_plot (self ):
1546
1546
self ._pos_prior = np .zeros (len (self .data ))
1547
1547
self ._neg_prior = np .zeros (len (self .data ))
1548
-
1548
+
1549
1549
if self ._is_ts_plot ():
1550
1550
data = self ._maybe_convert_index (self .data )
1551
1551
self ._make_ts_plot (data )
@@ -1565,7 +1565,7 @@ def _make_plot(self):
1565
1565
1566
1566
errors = self ._get_errorbars (label = label , index = i )
1567
1567
kwds = dict (kwds , ** errors )
1568
-
1568
+
1569
1569
label = com .pprint_thing (label ) # .encode('utf-8')
1570
1570
kwds ['label' ] = label
1571
1571
@@ -1613,7 +1613,7 @@ def _get_stacked_values(self, y, label):
1613
1613
def _get_ts_plot_function (self ):
1614
1614
from pandas .tseries .plotting import tsplot
1615
1615
plotf = self ._get_plot_function ()
1616
-
1616
+
1617
1617
def _plot (data , ax , label , style , ** kwds ):
1618
1618
# errorbar function does not support style argument
1619
1619
if plotf .__name__ == 'errorbar' :
@@ -1722,7 +1722,7 @@ def _get_plot_function(self):
1722
1722
raise ValueError ("Log-y scales are not supported in area plot" )
1723
1723
else :
1724
1724
f = LinePlot ._get_plot_function (self )
1725
-
1725
+
1726
1726
def plotf (* args , ** kwds ):
1727
1727
lines = f (* args , ** kwds )
1728
1728
@@ -1746,12 +1746,12 @@ def plotf(*args, **kwds):
1746
1746
1747
1747
self .plt .Axes .fill_between (* args , ** kwds )
1748
1748
return lines
1749
-
1749
+
1750
1750
return plotf
1751
1751
1752
1752
def _add_legend_handle (self , handle , label , index = None ):
1753
1753
from matplotlib .patches import Rectangle
1754
- # Because fill_between isn't supported in legend,
1754
+ # Because fill_between isn't supported in legend,
1755
1755
# specifically add Rectangle handle here
1756
1756
alpha = self .kwds .get ('alpha' , 0.5 )
1757
1757
handle = Rectangle ((0 , 0 ), 1 , 1 , fc = handle .get_color (), alpha = alpha )
@@ -1766,14 +1766,14 @@ def _post_plot_logic(self):
1766
1766
if self .xlim is None :
1767
1767
for ax in self .axes :
1768
1768
ax .set_xlim (0 , len (self .data )- 1 )
1769
-
1769
+
1770
1770
if self .ylim is None :
1771
1771
if (self .data >= 0 ).all ().all ():
1772
1772
for ax in self .axes :
1773
1773
ax .set_ylim (0 , None )
1774
1774
elif (self .data <= 0 ).all ().all ():
1775
1775
for ax in self .axes :
1776
- ax .set_ylim (None , 0 )
1776
+ ax .set_ylim (None , 0 )
1777
1777
1778
1778
1779
1779
class BarPlot (MPLPlot ):
@@ -1923,7 +1923,7 @@ def _args_adjust(self):
1923
1923
self .logy = False
1924
1924
self .logx = False
1925
1925
self .loglog = False
1926
-
1926
+
1927
1927
def _get_layout (self ):
1928
1928
from pandas import DataFrame
1929
1929
if isinstance (self .data , DataFrame ):
@@ -1982,8 +1982,8 @@ class HistPlot(MPLPlot):
1982
1982
_series_kinds = ['pie' ]
1983
1983
_all_kinds = _common_kinds + _dataframe_kinds + _series_kinds
1984
1984
1985
- _plot_klass = {'line' : LinePlot , 'bar' : BarPlot , 'barh' : BarPlot ,
1986
- 'kde' : KdePlot ,
1985
+ _plot_klass = {'line' : LinePlot , 'bar' : BarPlot , 'barh' : BarPlot ,
1986
+ 'kde' : KdePlot ,
1987
1987
'scatter' : ScatterPlot , 'hexbin' : HexBinPlot ,
1988
1988
'area' : AreaPlot , 'pie' : PiePlot }
1989
1989
@@ -2101,7 +2101,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
2101
2101
elif kind in _series_kinds :
2102
2102
if y is None and subplots is False :
2103
2103
msg = "{0} requires either y column or 'subplots=True'"
2104
- raise ValueError (msg .format (kind ))
2104
+ raise ValueError (msg .format (kind ))
2105
2105
elif y is not None :
2106
2106
if com .is_integer (y ) and not frame .columns .holds_integer ():
2107
2107
y = frame .columns [y ]
@@ -2113,8 +2113,8 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
2113
2113
fontsize = fontsize , use_index = use_index , sharex = sharex ,
2114
2114
sharey = sharey , xticks = xticks , yticks = yticks ,
2115
2115
xlim = xlim , ylim = ylim , title = title , grid = grid ,
2116
- figsize = figsize ,
2117
- sort_columns = sort_columns ,
2116
+ figsize = figsize ,
2117
+ sort_columns = sort_columns ,
2118
2118
** kwds )
2119
2119
else :
2120
2120
if x is not None :
@@ -2504,7 +2504,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2504
2504
The size of the figure to create in inches by default
2505
2505
layout: (optional) a tuple (rows, columns) for the layout of the histograms
2506
2506
bins: integer, default 10
2507
- Number of histogram bins to be used
2507
+ Number of histogram bins to be used
2508
2508
kwds : other plotting keyword arguments
2509
2509
To be passed to hist function
2510
2510
"""
@@ -2538,7 +2538,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2538
2538
sharex = sharex , sharey = sharey , figsize = figsize )
2539
2539
2540
2540
for i , col in enumerate (com ._try_sort (data .columns )):
2541
- ax = axes [i / ncols , i % ncols ]
2541
+ ax = axes [i // ncols , i % ncols ]
2542
2542
ax .xaxis .set_visible (True )
2543
2543
ax .yaxis .set_visible (True )
2544
2544
ax .hist (data [col ].dropna ().values , bins = bins , ** kwds )
@@ -2583,7 +2583,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
2583
2583
figsize : tuple, default None
2584
2584
figure size in inches by default
2585
2585
bins: integer, default 10
2586
- Number of histogram bins to be used
2586
+ Number of histogram bins to be used
2587
2587
kwds : keywords
2588
2588
To be passed to the actual plotting function
2589
2589
@@ -3046,7 +3046,7 @@ def on_right(i):
3046
3046
if naxes != nplots :
3047
3047
for ax in axarr [naxes :]:
3048
3048
ax .set_visible (False )
3049
-
3049
+
3050
3050
if squeeze :
3051
3051
# Reshape the array to have the final desired dimension (nrow,ncol),
3052
3052
# though discarding unneeded dimensions that equal 1. If we only have
0 commit comments