{ "cells": [ { "cell_type": "markdown", "id": "f06e1ccf-cf80-4b5f-8ffb-9b8ec97c2b2a", "metadata": {}, "source": [ "# Configuring nudge with `nudge_unit`\n", "\n", "A new parameter, `nudge_unit`, has been added to `geom_text`, allowing you to specify the units in which the offset is applied.\n", "\n", "Available values: `'identity'`, `'size'`, and `'px'`.\n", "\n", "- `'identity'`: A value of 1 corresponds to the distance from 0 to 1 on the axis.\n", "- `'size'`: A value of 1 corresponds to the diameter of a point with size 1.\n", "- `'px'`: A value of 1 corresponds to 1 pixel." ] }, { "cell_type": "code", "execution_count": 1, "id": "9ef6598d-3dcf-4297-8010-75f90c7838c6", "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 numpy as np\n", "import pandas as pd\n", "from lets_plot import *\n", "from lets_plot.geo_data import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "id": "78a745d4-30e6-4c63-947b-99543875d337", "metadata": {}, "source": [ "#### Without nudge" ] }, { "cell_type": "code", "execution_count": 2, "id": "44c46535-64ac-49d2-9a43-76b44d2aa8f1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "