@@ -3845,7 +3845,7 @@ def boxplot(self, column=None, by=None, ax=None, fontsize=None,
3845
3845
3846
3846
def plot (self , subplots = False , sharex = True , sharey = False , use_index = True ,
3847
3847
figsize = None , grid = True , legend = True , rot = 30 , ax = None ,
3848
- kind = 'line' , ** kwds ):
3848
+ kind = 'line' , sort_columns = True , ** kwds ):
3849
3849
"""
3850
3850
Make line plot of DataFrame's series with the index on the x-axis using
3851
3851
matplotlib / pylab.
@@ -3861,6 +3861,8 @@ def plot(self, subplots=False, sharex=True, sharey=False, use_index=True,
3861
3861
use_index : boolean, default True
3862
3862
Use index as ticks for x axis
3863
3863
kind : {'line', 'bar'}
3864
+ sort_columns: boolean, default True
3865
+ Sort column names to determine plot ordering
3864
3866
kwds : keywords
3865
3867
Options to pass to Axis.plot
3866
3868
@@ -3903,7 +3905,12 @@ def plot(self, subplots=False, sharex=True, sharey=False, use_index=True,
3903
3905
need_to_set_xticklabels = False
3904
3906
x = range (len (self ))
3905
3907
3906
- for i , col in enumerate (_try_sort (self .columns )):
3908
+ if sort_columns :
3909
+ columns = _try_sort (self .columns )
3910
+ else :
3911
+ columns = self .columns
3912
+
3913
+ for i , col in enumerate (columns ):
3907
3914
empty = self [col ].count () == 0
3908
3915
y = self [col ].values if not empty else np .zeros (x .shape )
3909
3916
0 commit comments