Skip to content

Commit af5c12c

Browse files
committed
added additional snippets
1 parent 509a77c commit af5c12c

8 files changed

+940
-33
lines changed

.ipynb_checkpoints/matplotlib_histogram-checkpoint.ipynb

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:a3ca72385e672b8355c9ae97f541589ced41ba0497f41237627db93034f380fa"
4+
"signature": "sha256:3b458396023b4f0bb16484203d4883085bdd18ca77786ee4258987b04502cac1"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -374,23 +374,34 @@
374374
"data1 = df['attacker_size'][df['attacker_size'] < 90000]\n",
375375
"data2 = df['defender_size'][df['attacker_size'] < 90000]\n",
376376
"\n",
377-
"# Create 10 bins\n",
377+
"# Create 10 bins with the minimum \n",
378+
"# being the smallest value of data1 and data2 \n",
378379
"bins = np.linspace(min(data1 + data2), \n",
380+
" # the max being the highest value\n",
379381
" max(data1 + data2),\n",
382+
" # and divided into 10 bins\n",
380383
" 10)\n",
381384
"\n",
382385
"# Plot a histogram of attacker size\n",
383386
"plt.hist(data1, \n",
387+
" # with bins defined as\n",
384388
" bins=bins, \n",
389+
" # with alpha\n",
385390
" alpha=0.5, \n",
391+
" # with color\n",
386392
" color='#EDD834',\n",
393+
" # labelled attacker\n",
387394
" label='Attacker')\n",
388395
"\n",
389396
"# Plot a histogram of defender size\n",
390397
"plt.hist(data2, \n",
398+
" # with bins defined as\n",
391399
" bins=bins, \n",
400+
" # with alpha\n",
392401
" alpha=0.5, \n",
402+
" # with color\n",
393403
" color='#887E43',\n",
404+
" # labeled defender\n",
394405
" label='Defender')\n",
395406
"\n",
396407
"# Set the x and y boundaries of the figure\n",

0 commit comments

Comments
 (0)