0

I have the following data

import numpy as np
x_values = np.array([   2,    4,    5,    8,   10,   20,   50,  100,  500, 1000])
y_values = np.array([0.00065542, 0.00201097, 0.0013085 , 0.00106739, 0.00389565,
       0.00433996, 0.0040773 , 0.00305874, 0.02045725, 0.02852656])

and I want to plot a log-log barplot. This is my attempt

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.bar(x=x_values, y=y_values, width=1.0)
ax.loglog()
plt.show()

but it looks awful

enter image description here

I don't understand why the bars are wrong.

Physics_Student
  • 556
  • 2
  • 9

0 Answers0