I am trying to read data from a txt file containing 200 values and then trying to plot a histogram based on the data. However, there are too many values on the xticks
, and I do not know how to fix this.
My code:
import math
import numpy as np
import matplotlib.pyplot as plt
f=open('LedData.rtf',"r")
lines=f.readlines()
result=[]
for x in lines:
result.append(x.split(',')[1])
f.close()
plt.hist(result)
plt.xticks(rotation = 'vertical')
plt.show
Histogram : Here is an image for reference.
Thanks for any help.