<jupyter_start><jupyter_text>Part 4 : Stack Plots / Area Plots---Using these plots, we can make comparisions over time / progression over time.This notebook is a continuation from Parts 1-3. *    Part1 - Introduction with line plots*    Part2 - Bar plots*    Part3 - Pie PlotsLets write some quick starter code for stack a plot<jupyter_code>from matplotlib import pyplot as plt

# Apply your plt style here
plt.style.use('fivethirtyeight')

# Create pie plot  
minutes = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# How many points have these players scored over time.
player1 = [1, 2, 3, 3, 4, 4, 4, 4, 5]
player2 = [1, 1, 1, 1, 2, 2, 2, 3, 4]
player3 = [1, 1, 1, 2, 2, 2, 3, 3, 3]

# we could also pass multi-dimensional array
plt.stackplot(minutes, player1, player2, player3)

plt.title("My Awesome Stack Chart")
plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>Now, lets add labels to this plot.*    If **legend** is not in the right place we can always change it. Let's change this in our chart. (Thi was on top right before our change)*    Like before, we can also change the **colors** of the plot.<jupyter_code>from matplotlib import pyplot as plt

# Apply your plt style here
plt.style.use('fivethirtyeight')

# Create pie plot  
minutes = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# How many points have these players scored over time.
player1 = [1, 2, 3, 3, 4, 4, 4, 4, 5]
player2 = [1, 1, 1, 1, 2, 2, 2, 3, 4]
player3 = [1, 1, 1, 2, 2, 2, 3, 3, 3]

labels = ['player1', 'player2', 'player3']
colors = ['#6d904f', '#fc4f30', '#008fd5']

# we could also pass multi-dimensional array
plt.stackplot(minutes, player1, player2, player3, labels=labels, colors=colors)

plt.title("My Awesome Stack Chart")
plt.tight_layout()
plt.legend(loc='upper left')
plt.show()<jupyter_output><empty_output><jupyter_text><jupyter_code>from matplotlib import pyplot as plt

# Apply your plt style here
plt.style.use('fivethirtyeight')

# Create pie plot  
days = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# Developers handing over the project over a course of time.
# Data of time spent by each developer on a project (8hrs time per day)
developer1 = [8, 6, 5, 5, 4, 2, 1, 1, 0]
developer2 = [0, 1, 2, 2, 2, 4, 4, 4, 4]
developer3 = [0, 1, 1, 1, 2, 2, 3, 3, 4]

labels = ['player1', 'player2', 'player3']
colors = ['#6d904f', '#fc4f30', '#008fd5']

# we could also pass multi-dimensional array
plt.stackplot(minutes, player1, player2, player3, labels=labels, colors=colors)

plt.title("My Awesome Stack Chart")
plt.tight_layout()
# plt.legend(loc='lower left')
# legend is located is 7% from the left and, 5% away from the bottom
plt.legend(loc=(0.07, 0.05))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13729891507669287, 'fraction_numerical': 0.06322484100261878, 'mean_word_length': 4.348, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '275434', 'license': 'MIT', 'n_tokens_mistral': 1123, 'n_tokens_neox': 973, 'n_words': 380, 'path': 'Matplotlib_Part4_StackPlots.ipynb', 'repo_name': 'bgswaroop/python-matplotlib', 'size': '2673'}