{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Rotation of Axis Labels\n", "\n", "The `angle` parameter in `element_text()` function allows to rotate the text. \n", "\n", "Note: currently this only works for axis labels, i.e. for `axis_text, axis_text_x, axis_text_y` parameters in `theme()`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. [Default Axis Labels Layout](#1.-Default-Axis-Labels-Layout) \n", "\n", "2. [Layout Labels for Discrete Axis](#2.-Layout-Labels-for-Discrete-Axis) \n", " \n", "3. [Layout Labels for Continuous Axis](#3.-Layout-Labels-for-Continuous-Axis)\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()\n", "LetsPlot.set_theme(theme_light())" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(437, 29)\n" ] }, { "data": { "text/html": [ "\n", " | Unnamed: 0 | \n", "PID | \n", "county | \n", "state | \n", "area | \n", "poptotal | \n", "popdensity | \n", "popwhite | \n", "popblack | \n", "popamerindian | \n", "... | \n", "percollege | \n", "percprof | \n", "poppovertyknown | \n", "percpovertyknown | \n", "percbelowpoverty | \n", "percchildbelowpovert | \n", "percadultpoverty | \n", "percelderlypoverty | \n", "inmetro | \n", "category | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "561 | \n", "ADAMS | \n", "Illinois | \n", "0.052 | \n", "66090 | \n", "1270.961540 | \n", "63917 | \n", "1702 | \n", "98 | \n", "... | \n", "19.631392 | \n", "4.355859 | \n", "63628 | \n", "96.274777 | \n", "13.151443 | \n", "18.011717 | \n", "11.009776 | \n", "12.443812 | \n", "0 | \n", "AAR | \n", "
1 | \n", "2 | \n", "562 | \n", "ALEXANDER | \n", "Illinois | \n", "0.014 | \n", "10626 | \n", "759.000000 | \n", "7054 | \n", "3496 | \n", "19 | \n", "... | \n", "11.243308 | \n", "2.870315 | \n", "10529 | \n", "99.087145 | \n", "32.244278 | \n", "45.826514 | \n", "27.385647 | \n", "25.228976 | \n", "0 | \n", "LHR | \n", "
2 | \n", "3 | \n", "563 | \n", "BOND | \n", "Illinois | \n", "0.022 | \n", "14991 | \n", "681.409091 | \n", "14477 | \n", "429 | \n", "35 | \n", "... | \n", "17.033819 | \n", "4.488572 | \n", "14235 | \n", "94.956974 | \n", "12.068844 | \n", "14.036061 | \n", "10.852090 | \n", "12.697410 | \n", "0 | \n", "AAR | \n", "
3 | \n", "4 | \n", "564 | \n", "BOONE | \n", "Illinois | \n", "0.017 | \n", "30806 | \n", "1812.117650 | \n", "29344 | \n", "127 | \n", "46 | \n", "... | \n", "17.278954 | \n", "4.197800 | \n", "30337 | \n", "98.477569 | \n", "7.209019 | \n", "11.179536 | \n", "5.536013 | \n", "6.217047 | \n", "1 | \n", "ALU | \n", "
4 | \n", "5 | \n", "565 | \n", "BROWN | \n", "Illinois | \n", "0.018 | \n", "5836 | \n", "324.222222 | \n", "5264 | \n", "547 | \n", "14 | \n", "... | \n", "14.475999 | \n", "3.367680 | \n", "4815 | \n", "82.505140 | \n", "13.520249 | \n", "13.022889 | \n", "11.143211 | \n", "19.200000 | \n", "0 | \n", "AAR | \n", "
5 rows × 29 columns
\n", "