{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "4649fe0a-4bd8-42dc-b51c-2b2876a329f4", "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" ] }, { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import math\n", "import random\n", "import numpy as np\n", "import pandas as pd\n", "\n", "from lets_plot import *\n", "from lets_plot.geo_data import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "93113abb-88c1-4acd-8890-296d5d6d1470", "metadata": {}, "outputs": [], "source": [ "LetsPlot.set_theme(theme(plot_background=element_rect(size=3)))" ] }, { "cell_type": "code", "execution_count": 3, "id": "92f5b6fe-8797-4d9a-a8ec-7a0f9e0457cd", "metadata": {}, "outputs": [], "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" ] }, { "cell_type": "markdown", "id": "a0aa16b5-94a6-4691-8e58-48b4cc7f440d", "metadata": {}, "source": [ "# Scatter plot" ] }, { "cell_type": "code", "execution_count": 4, "id": "b6b03e95-28c7-47a9-9b82-0a9a07bfbb88", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "