Skip to content

Commit

Permalink
Remove ipywidget cell (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Feb 27, 2019
1 parent cd7ed4c commit 48a13f3
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions notebooks/oggm-edu/surging_experiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -450,42 +450,6 @@
"axs[1].legend(handles=label, bbox_to_anchor=(1, 0.5));"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We now plot the different glacier shapes after each surge for the high surging glacier. (If it does not work properly, run the cell again)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plot the intermediate steps of surging glacier\n",
"%matplotlib notebook\n",
"import matplotlib.pyplot as plt\n",
"import ipywidgets\n",
"\n",
"# Plotting the bed\n",
"f, ax = plt.subplots(figsize=(9, 6))\n",
"ax.plot(strong_surge_model[0].fls[-1].bed_h, color='k', label='Bedrock')\n",
"\n",
"# Plotting the first surface\n",
"gl = ax.plot(strong_surge_model[1][0], label='Glacier')[0]\n",
"plt.tight_layout()\n",
"plt.legend();\n",
"\n",
"# Plotting glacier evolution - NOT ALWAYS WORKING PROPERLY\n",
"def plot_func(freq):\n",
" gl.set_ydata(strong_surge_model[1][freq])\n",
" f.canvas.draw()\n",
" \n",
"freq = ipywidgets.IntSlider(value=0, min=0, max=len(strong_surge_model[1])-1, step=1, description='Surge:')\n",
"ipywidgets.interact(plot_func, freq=freq);"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -521,7 +485,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.5.2"
},
"toc": {
"base_numbering": 1,
Expand Down

0 comments on commit 48a13f3

Please sign in to comment.