{ "cells": [ { "cell_type": "markdown", "id": "4dd58eba", "metadata": {}, "source": [ "## The GeoJson structure breaks if the ring start label occurs several times" ] }, { "cell_type": "markdown", "id": "b8b15711", "metadata": {}, "source": [ "### Comparing With `Matplotlib`" ] }, { "cell_type": "code", "execution_count": 1, "id": "5df44e79", "metadata": {}, "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": [ "import numpy as np\n", "import geopandas as gp\n", "from lets_plot import *\n", "from lets_plot.geo_data import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "3f50b680", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def dump_plot(plot, display=None):\n", " import json\n", "\n", " try:\n", " import clipboard\n", " except:\n", " clipboard = None\n", " \n", " from lets_plot._type_utils import standardize_dict\n", " \n", " plot_dict = standardize_dict(plot.as_dict())\n", " plot_json = json.dumps(plot_dict, indent=2)\n", " \n", " if clipboard:\n", " clipboard.copy('')\n", " clipboard.copy(str(plot_json))\n", " else:\n", " if display is None:\n", " display = True\n", " \n", " if display:\n", " print(plot_json)\n", "\n", " return plot\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "d044c499", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "