I'm trying to display two charts at the same time using matplotlib.
But I have to close one graph then only I can see the other graph. Is there anyway to display both the graphs or more number of graphs at the same time.
Here is my code
num_pass=np.size(data[0::,1].astype(np.float)) num_survive=np.sum(data[0::,1].astype(np.float)) prop=num_survive/num_pass num_dead=num_pass-num_survive #print num_dead labels='Dead','Survived' sizes=[num_dead,num_survive] colors=['darkorange','green'] mp.axis('equal') mp.title('Titanic Survival Chart') mp.pie(sizes, explode=(0.02,0), labels=labels,colors=colors,autopct='%1.1f%%', shadow=True, startangle=90) mp.show() women_only_stats = data[0::,4] == "female" men_only_stats = data[0::,4] != "female" # Using the index from above we select the females and males separately women_onboard = data[women_only_stats,1].astype(np.float) men_onboard = data[men_only_stats,1].astype(np.float) labels='Men','Women' sizes=[np.sum(women_onboard),np.sum(men_onboard)] colors=['purple','red'] mp.axis('equal') mp.title('People on board') mp.pie(sizes, explode=(0.01,0), labels=labels,colors=colors,autopct='%1.1f%%', shadow=True, startangle=90) mp.show() How can I show both the graphs at the same time?
mp.show()only at the end after creating all the plots.