0

I am trying to plot a horizontal bar graph in python with the x-axis in the logarithmic scale. I have written this code so far. It is on a linear scale. Can anybody please tell me how can I convert the linear scale on the x-axis into the logarithmic scale?

# importing package
import matplotlib.pyplot as plt
import pandas as pd
  
# create data
df = pd.DataFrame([['A', 10, 20, 10, 30], ['B', 20, 25, 15, 25], ['C', 12, 15, 19, 6],
                   ['D', 10, 29, 13, 19]],
                  columns=['Team', 'Round 1', 'Round 2', 'Round 3', 'Round 4'])
# view data
print(df)
  
# plot grouped bar chart
df.plot.barh(x='Team',        
        stacked=False,
        title='Grouped Bar Graph with dataframe')

Bar Graph as Obtained

Anwesa Roy
  • 73
  • 6

0 Answers0