X axis was inverted automatically and unexpectedly when plotting a series of data against another series of data using pandas. Please look at my code below. How can I ensure
To invert the graph you can use
arr1 = [1,2,3,4,5] arr2 = [9,8,4,3,8] df = pd.Dataframe(arr1,arr2) df.plot.barh()
if you also want to print the graph in sorting then you can use
df.sort_values().plot.barh()
To enlarge the size of graph you can use
df.sort_values().plot.barh(figsize=(10,20))