{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "ed6fd736", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:51:54.366305Z", "iopub.status.busy": "2025-11-05T13:51:54.366217Z", "iopub.status.idle": "2025-11-05T13:51:54.395483Z", "shell.execute_reply": "2025-11-05T13:51:54.395241Z" } }, "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": "05dd2107-cfca-400e-9e44-46c976d686c8", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:51:54.396438Z", "iopub.status.busy": "2025-11-05T13:51:54.396366Z", "iopub.status.idle": "2025-11-05T13:51:54.398260Z", "shell.execute_reply": "2025-11-05T13:51:54.398077Z" } }, "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": "2025-11-05T13:51:54.399094Z", "iopub.status.busy": "2025-11-05T13:51:54.399020Z", "iopub.status.idle": "2025-11-05T13:51:55.638291Z", "shell.execute_reply": "2025-11-05T13:51:55.637966Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "country = 'Japan'\n", "bbox = geocode_countries(names=country)\n", "gdf = geocode_states().scope(bbox).inc_res(4).get_boundaries()\n", "\n", "ggplot() + \\\n", " geom_rect(data=bbox.get_boundaries(), fill='lightslategray', size=0) + \\\n", " geom_map(data=gdf, color='lightslategray', fill='white') + \\\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 }