简体   繁体   中英

Seaborn does not show lineplot data in order

Recently I've been practicing with Seaborn, and I've had the next problem:

I have a basic dataset:

在此处输入图片说明

I try to plot a lineplot as follows:

prueba = pd.read_csv('prueba.csv')
sns.lineplot(data=prueba, x="mes", y="cantidad")

Where pd and sns are alias for pandas and seaborn, respectively.

When I got the plot, I have the next:

在此处输入图片说明

Which is not what I need. I'd need the graph in order, like my original dataset. Something in the x axis like: "marzo, abril, mayo, junio, julio" and not " mayo, marzo, junio, julio, abril ".

I tried with the argument sort=False but it didn't work out.

Any ideas?

Thanks in advance, Ciro.

Thanks for answering.

The problem was that I had an unupdated version of Seaborn. I could fix it by doing so:

conda update seaborn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM