{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Multi-line Labels in Legend\n", "\n", "The 'newline' character (`\\n`) now works as 'line break' in the legend text." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "mpg = pd.read_csv (\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "p = ggplot(mpg, aes(\"displ\", \"hwy\")) + geom_point(aes(color=\"cty\", shape=\"drv\"), size=5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Legend labels with 'line breaks'." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "