Skip to content

Instantly share code, notes, and snippets.

@uomodellamansarda
Last active November 21, 2020 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uomodellamansarda/58b96a1c1d5b53d793c64502ec9397eb to your computer and use it in GitHub Desktop.
Save uomodellamansarda/58b96a1c1d5b53d793c64502ec9397eb to your computer and use it in GitHub Desktop.
#plot section
fig,ax=plt.subplots(figsize=(8,4),
facecolor='white', dpi=300)
#b1 b2 b3 b4 contains the total revenues
#divided by revenue range
#b1<20 $ billion
#20<b2<40 $ billion
#40<b3<60 $ billion
#60<b4 $ billion
ax.bar(b1x,b1,color="lavender")
ax.bar(b2x,b2,color="cornflowerblue")
ax.bar(b3x,b3,color="blue")
ax.bar(b4x,b4,color="midnightblue")
ax.plot(y_range,y1,'--',color="yellow")
ax.plot(y_range,y2,'--',color="orange")
ax.plot(y_range,y3,'--',color="red")
ax.set_title("The Walt Disney Company Revenues")
water_x=(min(y_range)+max(y_range))/2
water_y=max(y2)/4
plt.text(water_x, water_y, 'Data Elaboration Ing. Andrea Ciufo. Data Source: https://data.world/',
fontsize=10, color='gray',
ha='center', va='top', alpha=0.5)
plt.text(water_x, x1+5000, '$20 Billions',
fontsize=10, color='darkred',
ha='center', va='top', alpha=0.5)
plt.text(water_x, x2+5000, '$40 Billions ',
fontsize=10, color='darkred',
ha='center', va='top', alpha=0.5)
plt.text(water_x, x3+5000, '$60 Billions',
fontsize=10, color='darkred',
ha='center', va='top', alpha=0.5)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment