Last active
November 21, 2020 17:14
-
-
Save uomodellamansarda/58b96a1c1d5b53d793c64502ec9397eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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