{ "cells": [ { "cell_type": "markdown", "id": "1c5474f7-dcb1-41ad-9ede-70a1b146f618", "metadata": {}, "source": [ "# Multiline Axis Labels\n", "\n", "Multiline axis labels allow better visualization of long categorical values. Instead of overcrowding the axis, labels can now be formatted across multiple lines, enhancing readability. \n", "\n", "* To create a multiline axis label, simply add \"\\n\" inside the string where you want the line break." ] }, { "cell_type": "code", "execution_count": 1, "id": "de90a7f0-1e1d-4c26-acc0-8da15c2a96fc", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import kotlin.random.Random\n", "\n", "%useLatestDescriptors\n", "%use dataframe\n", "%use lets-plot" ] }, { "cell_type": "markdown", "id": "da0c0aa7-62ef-4459-b128-9be1664a0403", "metadata": {}, "source": [ "## Quarters & Years" ] }, { "cell_type": "code", "execution_count": 2, "id": "60243931-5d37-4289-8f35-8c9ae8ca9a2f", "metadata": {}, "outputs": [ { "data": { "application/kotlindataframe+json": "{\"nrow\":4,\"ncol\":3,\"columns\":[\"Quarter_Year\",\"Type\",\"Amount\"],\"kotlin_dataframe\":[{\"Quarter_Year\":\"Q1-2022\",\"Type\":\"Income\",\"Amount\":15425},{\"Quarter_Year\":\"Q1-2022\",\"Type\":\"Expenses\",\"Amount\":7232},{\"Quarter_Year\":\"Q2-2022\",\"Type\":\"Income\",\"Amount\":13012},{\"Quarter_Year\":\"Q2-2022\",\"Type\":\"Expenses\",\"Amount\":8337}]}", "text/html": [ " \n", " \n", " \n", " \n", " \n", "DataFrame: rowsCount = 4, columnsCount = 3
\n", "| Quarter_Year | Type | Amount |
|---|---|---|
| Q1-2022 | Income | 15425 |
| Q1-2022 | Expenses | 7232 |
| Q2-2022 | Income | 13012 |
| Q2-2022 | Expenses | 8337 |