{ "cells": [ { "cell_type": "markdown", "id": "8c6e7594", "metadata": {}, "source": [ "# Horizontal and Vertical Facet Labels\n", "\n", "\n", "\n", "New `theme()` parameters allow to set the style for horizontal and vertical facet labels separately:\n", "\n", "- `strip_background_x` and `strip_background_y` parameters set the background of horizontal and vertical facet labels respectively, specified with `element_rect()`;\n", "\n", "- `strip_text_x` and `strip_text_y` - horizontal and vertical facet labels, specified with `element_text()`.\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "1bf79612", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "9e0f34c9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "d5fed6b5", "metadata": {}, "outputs": [], "source": [ "data = pd.DataFrame.from_records([\n", " (\"pet\", \"cat\", 5, \"carnivore\"),\n", " (\"pet\", \"dog\", 10, \"carnivore\"),\n", " (\"pet\", \"rabbit\", 2, \"herbivore\"),\n", " (\"pet\", \"hamster\", 1, \"herbivore\"),\n", "\n", " (\"farm\", \"cow\", 500, \"herbivore\"),\n", " (\"farm\", \"pig\", 100, \"carnivore\"),\n", " (\"farm\", \"horse\", 700, \"herbivore\"),\n", "])\n", "data.columns = (\"animal_type\", \"animal\", \"weight\", \"diet\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "17997a9c", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "