I want to have several different dataframes plotted on a graph. Which would look something like:
And each different plots are from different dataframes. The dataframes look something like (they have many more columns):
a b c d e f g h i j
0 27.0 1.74 12.63 50.0 Sejuani 18.0 5.28 1.17 6.48
1 22.0 1.58 17.00 56.0 Kalista 12.0 10.92 2.58 3.94
2 20.0 1.77 18.25 58.3 Gangplank 11.0 9.56 1.71 4.77
3 17.0 1.72 16.87 60.5 Ryze 12.0 10.75 2.56 4.02
7 27.0 1.61 11.08 54.2 Braum 11.0 2.68 0.25 6.32
8 28.0 1.73 16.36 53.3 Azir 13.0 10.35 3.07 3.13
9 29.0 1.83 16.56 55.4 Gnar 11.0 9.49 1.71 3.83
16 35.0 1.23 17.72 52.1 Ezreal 11.0 10.5 2.23 4.10
By default, the dataframes are in descending order according to a column that contains float values. I want to plot a column with the x-axis of the names. Current code I have is:
indices = [x for x in range(0, 30)]
x_tick = list(df_LCK['name'])
plt.xticks(indices, x_tick, rotation='vertical')
plt.plot(indices, df_LCK['pb'][:30])
plt.show()
And since top 30 items from each dataframes are all different, the xticks I declared above is only correct for one plot, and not matching for the other four.
Best would be reordering the dataframes so it's in alphabetical order, and in descending order according to a column. How would I have it so the x-ticks match the y-value for the rest of the plots? Is it to be done while plotting? Or is there a way to change the order of the dataframes' indices so they are in the way I want?