-
-
Save aletelecom/1b66a45239bff9e7e675519dc4fd3fa5 to your computer and use it in GitHub Desktop.
Viz 2
This file contains hidden or 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
#from matplotlib.pyplot import annotate | |
plt.rcParams.update({'font.size':25, 'figure.figsize': (30,10)}) | |
# Calculate the mean of ocupation, and the x axis of the text | |
mean = concat_df['ocupation_%'].mean() | |
text_x = concat_df['client_qty'].max() / 10 | |
# Create the scatter plot, the horizontal line, and the text | |
ax = concat_df.plot(kind='scatter', x='client_qty', y='ocupation_%', color='blue') | |
ax.axhline(mean, lw=8, color='green', label='Mean') | |
ax.text(text_x,mean, 'Mean occupation: {:.2f}'.format(mean), fontsize=25, va='center', ha='center', backgroundcolor='w') | |
ax.set_title('Traffic occupation percentage vs client quantity') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment