Python Forum
Problem with adjusting graph label
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with adjusting graph label
#1
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]
Reply


Messages In This Thread
Problem with adjusting graph label - by ekansh - Oct-13-2017, 10:32 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020