salleynealt / codecademy-dvp-2

Data Visualization with Python
0 stars 0 forks source link

Netflix Visualizations - Nice 3rd Graph! #5

Open jmcrey opened 6 years ago

jmcrey commented 6 years ago
revenue_by_quarter = [2.79, 2.98,3.29,3.7]
earnings_by_quarter = [.0656,.12959,.18552,.29012]
quarter_labels = ["2Q2017","3Q2017","4Q2017", "1Q2018"]
quarter_label2 = ["2nd-2017","3rd-2017","4th-2017", "1st-2018"]

# Revenue
n = 1
t = 2
d = len(revenue_by_quarter)
w = 0.9
bars1_x = [t*element + w*n for element
             in range(d)]
# Earnings
n = 2
t = 2
d = len(earnings_by_quarter)
w = 0.9
bars2_x = [t*element + w*n for element
             in range(d)]

middle_x = [ (a + b) / 2.0 for a, b in zip(bars1_x, bars2_x)]
labels = ["Revenue", "Earnings"]

plt.bar(bars1_x,revenue_by_quarter,color = "#a6c875",edgecolor = "#388004")
plt.bar(bars2_x,earnings_by_quarter,color = "#acc2d9",edgecolor = "blue")
plt.xticks(middle_x, quarter_label2)
plt.legend(labels)
plt.title("Netflix Revenue and Earnings 2017-2018")

plt.ylabel("US Dollars (Billions)")
plt.xlabel("Business Quarters")
plt.savefig("chart3.png")

Great job displaying this 3rd graph! It looks fantastic! I especially like that you used RGB compliant colors -- it shows true dedication and customization. Nice job!