pandas - plot sorted column to increasing integer index
This will first sort the series and then plot, ignoring the index of the series:
ts = pd.Series(np.random.randn(100), index=pd.date_range('1/1/2000', periods=100))
ts.sort_values().plot(use_index=False)
Let's say I have a pandas series with numerical values. What's the shortest way to plot the sorted series against an increasing integer index?
The plot should show:
x-axis: 0,1,2,3,4,...
y-axis: the sorted values of the series.
(please notice that I cannot plot it against the series' index, because the index is not necessarily an increasing index. In my case it's some id that I use for different reasons)
Thanks