{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "7fc7ce70", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from lets_plot import *\n", "\n", "import pandas as pd\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "b6519902", "metadata": {}, "outputs": [], "source": [ "# Support of multiple lines\n", "\n", "d = {\n", " 'hjust': [0, 0.5, 1],\n", " 'vjust': [0, 0.5, 1],\n", " 'angle': [0, 30],\n", " 'label': [\"first line\\nsecond line\"]\n", "}\n", "\n", "from itertools import product\n", "td = pd.DataFrame(product(*d.values()), columns=d.keys())\n", "\n", "p = (ggplot(td, aes(x='hjust', y='vjust')) + \n", " geom_point(size=3) +\n", " theme_light() + theme(panel_grid=element_blank())\n", ")\n", "\n", "pf = (p + scale_x_continuous(breaks=[0, 0.5, 1]) +\n", " scale_y_continuous(breaks=[0, 0.5, 1], expand=[0.4]) +\n", " facet_grid(x='angle', x_format='{d}°'))\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "cc9b5c4e", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "