{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "ed6fd736", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:12:02.187008Z", "iopub.status.busy": "2024-04-26T12:12:02.187008Z", "iopub.status.idle": "2024-04-26T12:12:03.240300Z", "shell.execute_reply": "2024-04-26T12:12:03.240300Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).\n" ] } ], "source": [ "from lets_plot.geo_data import *\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "c389af90-925c-4b5d-8bd7-7489d8572564", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:12:03.240300Z", "iopub.status.busy": "2024-04-26T12:12:03.240300Z", "iopub.status.idle": "2024-04-26T12:12:03.255999Z", "shell.execute_reply": "2024-04-26T12:12:03.255999Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "9c59d35d", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:12:03.255999Z", "iopub.status.busy": "2024-04-26T12:12:03.255999Z", "iopub.status.idle": "2024-04-26T12:12:04.198509Z", "shell.execute_reply": "2024-04-26T12:12:04.198509Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "country = 'Georgia'\n", "gdf_country = geocode_countries(names=country).inc_res(4).get_boundaries()\n", "gdf = geocode_counties().scope(country).get_centroids()\n", "\n", "ggplot() + \\\n", " geom_map(data=gdf_country, fill='#2c3e50') + \\\n", " geom_point(data=gdf, color='white', size=3, \\\n", " tooltips=layer_tooltips().line('@{found name}')) + \\\n", " ggsize(800, 600) + ggtitle(country) + \\\n", " theme_void()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.10.13" } }, "nbformat": 4, "nbformat_minor": 5 }