Skip to content

Instantly share code, notes, and snippets.

@aletelecom
Created July 29, 2022 13:57
Show Gist options
  • Save aletelecom/94b3949081f52cbccdb660ce21db3004 to your computer and use it in GitHub Desktop.
Save aletelecom/94b3949081f52cbccdb660ce21db3004 to your computer and use it in GitHub Desktop.
Viz 3 complete
plt.rcParams.update({'font.size':15, 'figure.figsize': (20,8)})
fig, ax = plt.subplots()
avg_speed = data_df['avg_speed']
client_per_olt = data_df['client_qty']
throughput_olt = data_df['throughput']
colors = data_df['colors']
scatter = ax.scatter(x=client_per_olt, y=avg_speed, c=colors.astype('category').cat.codes*100, s=avg_speed*400, alpha=0.3, cmap='prism')
lowest_t = throughput_olt.min()
hypothetical_olt = 'Highest speed per client OLT'
annotation = ax.annotate('{}'.format(hypothetical_olt), xytext=(.15,.5), xy=(800,15), xycoords='data', textcoords='axes fraction', arrowprops=dict(arrowstyle="->",
connectionstyle="arc3"))
ax.add_artist(annotation)
classes = ('gt 6Mbps','From 2Mbps to 6Mbps', 'lt 2Mbps')
legend1 = ax.legend(handles=scatter.legend_elements()[0]*10, labels=classes, loc='upper right', title='Legend')
ax.add_artist(legend1)
ax.set_ylim(0,20)
plt.xlabel('Client quantity per OLT')
plt.ylabel('Total Thoughput per OLT (Mbps)')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment