0

I have created 6 pie charts, however, they all appear separately. I would like to have them all appear on the same figure (3 rows, 2 columns). I have tried the subplot function but it keeps giving me errors.

These are the pie charts I have created, I am on python 2.7. I am new to coding and just need a bit of guidance for this trivial matter, thank you!

Also, if you have any tips on making this code more "streamlined", I'm all ears!

        colors = sns.cubehelix_palette(start=.5, rot=-.5)
        plt.figure(1)
        plt.pie([frt_tested, 1-frt_tested], labels=['tested', 'Not tested'], colors = colors, autopct='%.2f%%')
        plt.title('tested Items\n')
        plt.figure(2)
        plt.pie([frt_ntested, frt_otested, 1-frt_tested], labels=['New', 'Old', 'Not tested'], colors = colors, autopct='%.2f%%')
        plt.title('tested Items (New&Old)\n')
        plt.figure(3)
        plt.pie([frt_passed, 1-frt_passed], labels=['Passed', 'Not Passed'], colors = colors, autopct='%.2f%%')
        plt.title('Passed vs Not Passed items\n')
        plt.figure(4)
        plt.pie([frt_npassed, frt_opassed, 1-frt_passed], labels=['New', 'Old', 'Not Passed'], colors = colors, autopct='%.2f%%')
        plt.title('Passed items (New&Old)\n')
        plt.figure(5)
        plt.pie([frt_pass_tested, 1-frt_pass_tested], labels=['Passed', 'Not Passed'], colors = colors, autopct='%.2f%%')
        plt.title('Passed vs tested\n')
        plt.figure(6)
        plt.pie([frt_npass_tested, frt_opass_tested, 1-frt_pass_tested], labels=['New', 'Old', 'Not Passed'], colors = colors, autopct='%.2f%%')
        plt.title('Passed vs tested (Old&New)\n')
        plt.show()
Trenton McKinney
  • 43,885
  • 25
  • 111
  • 113
Boston Co
  • 49
  • 5

0 Answers0