{
"cells": [
{
"cell_type": "markdown",
"id": "f06e1ccf-cf80-4b5f-8ffb-9b8ec97c2b2a",
"metadata": {},
"source": [
"# Configuring Nudge Units in Position Adjustments\n",
"\n",
"The position adjustment `position_nudge()` now supports the `unit` parameter that specifies the measurement system for nudge offsets.
\n",
"Equivalent parameter is also available as `nudge_unit` in `geom_text()` and `geom_label()` directly. \n",
"\n",
"Available Units:\n",
"\n",
"- `'identity'` (default): nudge in data coordinates - a value of 1 corresponds to the distance from 0 to 1 on the axis\n",
"- `'size'`: nudge relative to point size - a value of 1 corresponds to the diameter of a point with size 1\n",
"- `'px'`: nudge in fixed pixels - a value of 1 corresponds to 1 pixel\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "9ef6598d-3dcf-4297-8010-75f90c7838c6",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-05T13:41:19.952817Z",
"iopub.status.busy": "2025-11-05T13:41:19.952698Z",
"iopub.status.idle": "2025-11-05T13:41:19.984582Z",
"shell.execute_reply": "2025-11-05T13:41:19.984278Z"
}
},
"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 import *\n",
"from lets_plot.geo_data import *"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2c2b568d-2da5-491d-8bad-7792afd7b68f",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-05T13:41:19.985425Z",
"iopub.status.busy": "2025-11-05T13:41:19.985340Z",
"iopub.status.idle": "2025-11-05T13:41:19.987450Z",
"shell.execute_reply": "2025-11-05T13:41:19.987173Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"