Skip to content

Commit

Permalink
Razsipni graf
Browse files Browse the repository at this point in the history
  • Loading branch information
KrOstir committed Jul 3, 2018
1 parent b9c130b commit 1997fb7
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Analiza vegetacije.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,23 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Histogram kanala 8\n",
"plt.hist(s2_b8[~np.isnan(s2_b8)], 200)"
"plt.hist(s2_b8[~np.isnan(s2_b8)], 50)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"s2_b4_flat = s2_b4.flat\n",
"s2_b8_flat = s2_b8.flat"
]
},
{
Expand All @@ -251,8 +263,14 @@
"metadata": {},
"outputs": [],
"source": [
"# 2D histogram\n",
"plt.hist2d(s2_b4[~np.isnan(s2_b4)], s2_b8[~np.isnan(s2_b8)], 200)"
"# Decimiramo\n",
"idx = np.random.choice(np.arange(len(s2_b4_flat)), 10000, replace=False)\n",
"s2_b4_sample = s2_b4.flat[idx]\n",
"s2_b8_sample = s2_b8.flat[idx]\n",
"# Razsevni diagram\n",
"plt.figure(figsize=(8,8))\n",
"plt.scatter(s2_b4_sample, s2_b8_sample, marker=\".\", s=1)\n",
"plt.show()"
]
},
{
Expand Down

0 comments on commit 1997fb7

Please sign in to comment.