Python Forum

Full Version: Problem with adjusting graph label
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to plot the content of csv file using python to the graph which is being plotted has got the values of x-axis go out of the image and also overlapped see the image attached in output generated output generated and the csv file link of github has been attached
import pandas as pd
import matplotlib.pyplot as plt
type = pd.read_csv("pig1.2\part-r-00000.csv",header=None)
print (type)
i=1
s=1
a =[]
b=[]
l=1
for i in type[0]:
    a.append(s)
    b.append(l)
    l=l+6
print (b)
plt.bar(b,type[1],align='center',width=3)
plt.xticks(b,type[0])
plt.xticks(rotation=34)
plt.verticalalignment='top'
plt.xlabel('aa')
plt.
plt.show()
[input]The csv file tobe usedThe csv file read in the python code[input]
Output:
The graph generated x labels are overwriiten the image attached here[img]https://github.com/EkanshMaheshwari/SuicideAnalysis/blob/master/graphs/abc.png[/img]