{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from ipywidgets import Output\n", "from ipyleaflet import WidgetControl" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "\n", "# Data for plotting\n", "t = np.arange(0.0, 2.0, 0.01)\n", "s = 1 + np.sin(2 * np.pi * t)\n", "\n", "fig, ax = plt.subplots()\n", "ax.plot(t, s)\n", "\n", "ax.set(xlabel='time (s)', ylabel='voltage (mV)',\n", " title='About as simple as it gets, folks')\n", "ax.grid()\n", "\n", "# Create an output widget to host the plot\n", "output_widget = Output()\n", "\n", "# Show the plot on the widget\n", "with output_widget:\n", " output_widget.clear_output()\n", " plt.show()\n", "\n", "# Add the widget as a control to the map\n", "output_control = WidgetControl(widget=output_widget, position=\"bottomright\")\n", "Map.add_control(output_control)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/QJqWLAF.png)" ] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }