#!/usr/bin/env python3.4 import matplotlib.pyplot as plt # Find statistics on the languages here # http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html # The slices will be ordered and plotted counter-clockwise. # Keep the order of your items consistent. # TODO: Replace these languages with the actual top six, plus on other category languages = ('Haskell', 'Perl', "Scheme") # TODO: Align the correct percentages here with their respective language above, making sure they all add up to 100 lang_pop_percent = [60, 30, 10] # For information on matplotlib colors visit here # http://matplotlib.org/api/colors_api.html # For a tool to pick a color by hex string visit here # http://www.color-hex.com/color-wheel/ # TODO: Make sure you have six colors here fore the above languages pie_colors = ['yellowgreen', 'gold', '#62f33f'] # TODO: "Explode" your favorite of the six languages using syntax you see below pie_explode = (0, 0, 0.1) # This statement is how we give all the data to matplotlib to create our pie chart. plt.pie(lang_pop_percent, explode=pie_explode, labels=languages, colors=pie_colors, autopct='%1.1f%%', shadow=True) # Set aspect ratio to be equal so that pie is drawn as a circle. See # what happens if this is removed. plt.axis('equal') # The title is overlapping the graph, change the statement below to fix this. # TODO: Fix the alignment of title by changing something in the below statement plt.title('Programming Language Popularity (TIOBE Index)', y=.95) plt.show()