Pandas plotting bar -


plots = '' fig = ''  plots = userdemo.gender.value_counts().plot(kind='bar', fontsize = '8') print userdemo.gender.value_counts() fig = plots.get_figure() fig.savefig('c:\\users\\user\\project\\reports\\genderbar.jpg')  plots1 = '' fig1 = '' print userdemo.age_range_desc.value_counts() plots1 = userdemo.age_range_desc.value_counts().plot(kind='bar', fontsize = '8') print userdemo.age_range_desc.value_counts() fig1 = plots1.get_figure() fig1.savefig('c:\\users\\user\\project\\reports\\agerangebar.jpg')  plots2 = '' fig2 = '' plots2 = userdemo.occupation_desc.value_counts().plot(kind='bar', fontsize = '8') print userdemo.occupation_desc.value_counts() fig2 = plots2.get_figure() fig2.savefig('c:\\users\\user\\project\\reports\\occupation.jpg') 

output:

the output when print seems ok. when bar graphs created, first 1 fine subsequent ones characteristics of first graph , show incorrect outputs.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -