{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The `orientation` Parameter\n", "\n", "Some geoms treat each axis differently and, thus, can have two orientations.\n", "\n", "The `orientation` parameter specifies the axis that the layer's stat and geom should run along (x-axis by default). " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:11:00.092438Z", "iopub.status.busy": "2024-04-26T12:11:00.092438Z", "iopub.status.idle": "2024-04-26T12:11:00.974770Z", "shell.execute_reply": "2024-04-26T12:11:00.974770Z" } }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "from lets_plot import *\n", "from lets_plot.mapping import as_discrete" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:11:00.974770Z", "iopub.status.busy": "2024-04-26T12:11:00.974770Z", "iopub.status.idle": "2024-04-26T12:11:00.990340Z", "shell.execute_reply": "2024-04-26T12:11:00.990340Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## One Axis Is Discrete, the Other Continuous" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:11:01.006112Z", "iopub.status.busy": "2024-04-26T12:11:01.006112Z", "iopub.status.idle": "2024-04-26T12:11:01.132537Z", "shell.execute_reply": "2024-04-26T12:11:01.132537Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(234, 12)\n" ] }, { "data": { "text/html": [ "\n", " | Unnamed: 0 | \n", "manufacturer | \n", "model | \n", "displ | \n", "year | \n", "cyl | \n", "trans | \n", "drv | \n", "cty | \n", "hwy | \n", "fl | \n", "class | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "audi | \n", "a4 | \n", "1.8 | \n", "1999 | \n", "4 | \n", "auto(l5) | \n", "f | \n", "18 | \n", "29 | \n", "p | \n", "compact | \n", "
1 | \n", "2 | \n", "audi | \n", "a4 | \n", "1.8 | \n", "1999 | \n", "4 | \n", "manual(m5) | \n", "f | \n", "21 | \n", "29 | \n", "p | \n", "compact | \n", "
2 | \n", "3 | \n", "audi | \n", "a4 | \n", "2.0 | \n", "2008 | \n", "4 | \n", "manual(m6) | \n", "f | \n", "20 | \n", "31 | \n", "p | \n", "compact | \n", "