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 -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -