{ "cells": [ { "cell_type": "markdown", "id": "76ded6e1", "metadata": {}, "source": [ "# Prevent overlapping labels in plotnine with automatic positioning\n", "\n", "To prevent labels from overlapping on top of each other, ggplot has ggrepel, while plotnine has [adjustText](https://adjusttext.readthedocs.io/en/latest/).\n", "\n", "## Read in our data" ] }, { "cell_type": "code", "execution_count": 2, "id": "579d4bae", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | country | \n", "continent | \n", "gdp_per_capita | \n", "life_expectancy | \n", "population | \n", "
---|---|---|---|---|---|
0 | \n", "Afghanistan | \n", "Asia | \n", "663 | \n", "54.863 | \n", "22856302 | \n", "
1 | \n", "Albania | \n", "Europe | \n", "4195 | \n", "74.200 | \n", "3071856 | \n", "