{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "0", "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, "id": "1", "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(\n", " xlabel=\"time (s)\", ylabel=\"voltage (mV)\", title=\"About as simple as it gets, folks\"\n", ")\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, "id": "2", "metadata": {}, "outputs": [], "source": [ "Map" ] }, { "cell_type": "markdown", "id": "3", "metadata": {}, "source": [ "![](https://i.imgur.com/QJqWLAF.png)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }