Prevent pandas df.plot() from sorting the y-axis
<p>Its very irritating that the pandas df.plot sorts the y-axis automatically in descending order.</p>

<pre><code>df1[:10].plot(x="Term",y="P-value",kind='barh')
</code></pre>

<p>I do not want to sort anything in my data frame and plot as it is. Is there any way to prevent automatic sorting ?</p>

<p>I tried to look at documentation and the plot() does not have any option to prevent sorting. I tried in google but I could not find the solution.</p>

<p>Example file ( tab delimited ):</p>

<pre><code>Term    p-value
De novo pyrimidine deoxyribonu  0.043726
Interleukin signaling pathway_  0.075241
Plasminogen activating cascade  0.099365
De novo purine biosynthesis_Ho  0.115435
Alzheimer disease-presenilin p  0.142836
Salvage pyrimidine ribonucleot  0.171718
Pyrimidine Metabolism_Homo sap  0.171718
Heterotrimeric G-protein signa  0.189208
p53 pathway_Homo sapiens_P0005  0.215917
Heterotrimeric G-protein signa  0.246512
</code></pre>

<p>Code snippet:</p>

<pre><code>import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("test.txt",sep='\t')
df.plot(x="Term",y="p-value",kind='barh')
plt.show()
</code></pre>

<p><a href="https://i.stack.imgur.com/w2ygY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w2ygY.png" alt="enter image description here"></a></p>