{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### The layer `orientation`\n", "\n", "Some geoms treat each axis differently and, thus, can thus have two orientations.\n", "\n", "The `orientation` parameter specifies the axis that the layer' stat and geom should run along (x-axis by default). " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "from lets_plot import *\n", "from lets_plot.mapping import as_discrete\n", "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### geom_bar()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "mpg = pd.read_csv(\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv\")\n", "\n", "base = ggplot(mpg) + ggsize(800, 300)\n", "manufacturer_mapping = as_discrete('manufacturer', order_by='..count..')\n", "hide_x_label = theme(axis_title_x='blank')\n", "hide_y_label = theme(axis_title_y='blank')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "