When I create a DataFrame, then sort by a column it appears to be sorted in the iteractive display (i.e. whatever repr gives), but when I call the DataFrame.plot() function it plots the unsorted array. Calling matplotlib.pylab.plot works fine though. I suspect it’s something to do with clever pointer rearrangement not being passed to whatever the plot function is calling to access the data … or maybe I’m just doing something dumb. I’ve tried this on pandas 0.8.1 (osx and linux with python2.7.something) and pandas 0.9.0 (osx with python3.something).
import pandas
import numpy
from matplotlib.pylab import *
a = numpy.random.randn(100,10)
df = pandas.DataFrame(a)
df.shape
df.sort(column=0)
df.columns
df.sort(column=0, inplace=True)
df[0]
df[0].plot()
Plotting is by default your data versus the index. In case of a numerical index, look at the index after sorting on a column. you might want to use plot(use_index=False). See example below.