{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import hvplot.pandas # noqa" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`barh()` is similar to `.bar()` but plots bars horizontally rather than vertically. These charts can be created from dataframes with regular `Index` or `MultiIndex`." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from bokeh.sampledata.autompg import autompg_clean as df\n", "\n", "table = df.groupby(['origin', 'mfr'])['mpg'].mean().sort_values()\n", "table.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "table.hvplot.barh('mfr', 'mpg', by='origin', stacked=True, legend='bottom_right', height=600)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 }