I have gone through bunch of questions on SO on similar content and read to understand anatomy of it still I am unable to figure out solution how to rotate the label.Other sources referred Link1 Link2 Link3 Below is my effort
fig, ax = plt.subplots()
# Although I have commented out this part it would be great to know what is wrong with it
#xaxis = myfiledic.keys()
#yaxis = myfiledic.values()
#ax.plot(xaxis, yaxis)
plt.bar(range(len(myfiledic)), myfiledic.values())
plt.xticks(range(len(myfiledic)), myfiledic.keys())
for line in ax.xaxis.get_majorticklabels():
print line
ax.set_xticklabels(ax.xaxis.get_majorticklabels(), rotation=45)
plt.show()
The print line points to below output. I m just trying to plot some files with C code and number of lines in it. So xlabel is the name of file which I was expecting and below is what I am getting
Text(0,0,'add_2_arrays.c')
Text(0,0,'bst.c')
Text(0,0,'sort_string_array.c')
Text(0,0,'palindrome_int.c')