{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Custom Layout" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use the `Layout` class to create a variety of map views for comparison.\n", "\n", "For more information, run `help(Layout)`.\n", "\n", "This example uses two different custom layouts. The first with a vertical orientation (2x2) and the second, horizontal (1x4)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from cartoframes.auth import set_default_credentials\n", "\n", "set_default_credentials('cartoframes')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", " CARTOframes\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", "
\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\n", "
\n", " "Static\n", " \n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "
\n", "
\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\n", "
\n", " "Static\n", " \n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\n", "
\n", " "Static\n", " \n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "
\n", "
\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\n", "
\n", " "Static\n", " \n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "\n", " \n", "\n", "
\n", "
\n", " :\n", "
\n", " \n", " \n", "
\n", "
\n", "\n", "
\n", " StackTrace\n", "
    \n", "
    \n", "
    \n", "\n", "\n", "\n", "\n", "\">\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from cartoframes.viz import Map, Layer, Layout\n", "\n", "Layout([\n", " Map(Layer('drought_wk_1')),\n", " Map(Layer('drought_wk_2')),\n", " Map(Layer('drought_wk_3')),\n", " Map(Layer('drought_wk_4'))\n", "], 2, 2)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", " CARTOframes\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", "
    \n", " \n", "
    \n", " \n", " \n", " \n", " \n", " \n", " \n", "
    \n", " \n", "\n", "
    \n", " "Static\n", " \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "\n", "
    \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "
    \n", " \n", " \n", " \n", " \n", " \n", " \n", "
    \n", " \n", "\n", "
    \n", " "Static\n", " \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "\n", "
    \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "
    \n", " \n", " \n", " \n", " \n", " \n", " \n", "
    \n", " \n", "\n", "
    \n", " "Static\n", " \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "\n", "
    \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "
    \n", " \n", " \n", " \n", " \n", " \n", " \n", "
    \n", " \n", "\n", "
    \n", " "Static\n", " \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "\n", "
    \n", "
    \n", "
    \n", " \n", "
    \n", " \n", "
    \n", "\n", " \n", "\n", "
    \n", "
    \n", " :\n", "
    \n", " \n", " \n", "
    \n", "
    \n", "\n", "
    \n", " StackTrace\n", "
      \n", "
      \n", "
      \n", "\n", "\n", "\n", "\n", "\">\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Layout([\n", " Map(Layer('drought_wk_1')),\n", " Map(Layer('drought_wk_2')),\n", " Map(Layer('drought_wk_3')),\n", " Map(Layer('drought_wk_4'))\n", "], 1, 4)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7" } }, "nbformat": 4, "nbformat_minor": 2 }