{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# INSTALL" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting roughviz\n", " Downloading https://files.pythonhosted.org/packages/a8/47/88e35b87730dd9c7ebb6807b8acbede6b1183f4c95cd7fb3e4a37f91b20b/roughviz-4.6.0-py3-none-any.whl\n", "Requirement already satisfied: Jinja2 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from roughviz) (2.10)\n", "Requirement already satisfied: pandas in /opt/conda/envs/Python36/lib/python3.6/site-packages (from roughviz) (0.24.1)\n", "Requirement already satisfied: MarkupSafe>=0.23 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from Jinja2->roughviz) (1.1.0)\n", "Requirement already satisfied: pytz>=2011k in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pandas->roughviz) (2018.9)\n", "Requirement already satisfied: numpy>=1.12.0 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pandas->roughviz) (1.15.4)\n", "Requirement already satisfied: python-dateutil>=2.5.0 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from pandas->roughviz) (2.7.5)\n", "Requirement already satisfied: six>=1.5 in /opt/conda/envs/Python36/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas->roughviz) (1.12.0)\n", "Installing collected packages: roughviz\n", "Successfully installed roughviz-4.6.0\n" ] } ], "source": [ "!pip install roughviz" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# IMPORT" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "import roughviz" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# VISUALIZE" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### BAR CHART" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd \n", "d = {'Year': ['1980', '1981', '1982'], 'A': [3, 4, 10]}\n", "df = pd.DataFrame(data=d)\n", "roughviz.bar(df[\"Year\"], df[\"A\"], axisRoughness = 0.7, axisStrokeWidth = 0.7, roughness=2.3, highlight=\"gray\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### HORIZONTAL BAR CHART" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd \n", "d = {'Year': ['1980', '1981', '1982'], 'A': [3, 4, 10]}\n", "df = pd.DataFrame(data=d)\n", "roughviz.barh(df[\"Year\"], df[\"A\"], axisRoughness = 0.7, axisStrokeWidth = 0.7, roughness=2.3, highlight=\"gray\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### STACKED BAR CHART" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import roughviz\n", "import pandas as pd \n", "d = {'Year': ['1980', '1981', '1982'], 'A': [3, 4, 10], 'B': [3, 4, 10]}\n", "df = pd.DataFrame(data=d)\n", "roughviz.stackedbar(df[\"Year\"], df[[\"A\",\"B\"]], axisRoughness = 0.7, axisStrokeWidth = 0.7, roughness=2.3, highlight=\"gray\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### PIE CHART" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd \n", "d = {'Year': ['1980', '1981', '1982'], 'A': [3, 4, 10]}\n", "df = pd.DataFrame(data=d)\n", "roughviz.pie(df[\"Year\"], df[\"A\"], axisRoughness = 0.7, axisStrokeWidth = 0.7, roughness=2.3, highlight=\"gray\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### DONUT CHART" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd \n", "d = {'Year': ['1980', '1981', '1982'], 'A': [3, 4, 10]}\n", "df = pd.DataFrame(data=d)\n", "roughviz.donut(df[\"Year\"], df[\"A\"], axisRoughness = 0.7, axisStrokeWidth = 0.7, roughness=2.3, highlight=\"gray\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.6", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" } }, "nbformat": 4, "nbformat_minor": 1 }