I have a graph that looks like this. It's a histogram and the x-axis is in a decreasing order.
Asked
Active
Viewed 34 times
1 Answers
1
Try using invert_axis()
import matplotlib.pyplot as plt
import numpy as np
data = np.random.randn(1000)
plt.hist(data, bins=20, density=True)
plt.gca().invert_xaxis()
plt.xlabel('Value')
plt.ylabel('Frequency')
plt.title('Descending Histogram')
plt.show()

sjri
- 93
- 5