Fixed Layouts in Columnar_Data
"cell_type": "markdown",
"metadata": {},
"source": [
- "To select a particular storage format explicitly, supply one or more allowed datatypes:"
+ "Note these include grid based datatypes, which are not covered in this tutorial. To select a particular storage format explicitly, supply one or more allowed datatypes:"
]
},
{
},
"outputs": [],
"source": [
- "%opts HeatMap [show_values=False xticks=40 xrotation=90 aspect=1.2 invert_yaxis=True colorbar=True]\n",
- "%opts Layout [figure_size=120 aspect_weight=0.5 hspace=0.8 vspace=0]"
+ "%opts HeatMap [show_values=False xticks=40 xrotation=90 aspect=1.2 invert_yaxis=True colorbar=True]"
]
},
{
},
"outputs": [],
"source": [
+ "%%opts Layout [aspect_weight=1 fig_size=150 sublabel_position=(-0.2, 1.)]\n",
"hv.Layout([macro.to.heatmap(['Year', 'Country'], value)\n",
" for value in macro.data.columns[2:]]).cols(2)"
]
"While looking at the plots individually like this allows us to study trends for each country, we may want to lay out a subset of the countries side by side, e.g. for non-interactive publications. We can easily achieve this by selecting the countries we want to view and and then applying the ``.layout`` method. We'll also want to restore the square aspect ratio so the plots compose nicely."
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "%opts Overlay [aspect=1]"
- ]
- },
{
"cell_type": "code",
"execution_count": null,
},
"outputs": [],
"source": [
- "%%opts NdLayout [figure_size=100] Scatter [color_index=2] (cmap='Reds')\n",
+ "%%opts NdLayout [figure_size=100] Overlay [aspect=1] Scatter [color_index=2] (cmap='Reds')\n",
"countries = {'United States', 'Canada', 'United Kingdom'}\n",
"(gdp_curves * gdp_unem_scatter).select(Country=countries).layout('Country')"
]
},
"outputs": [],
"source": [
- "%%opts Layout [fig_size=100] Scatter [color_index=2] (cmap='Reds')\n",
+ "%%opts Scatter [color_index=2] (cmap='Reds') Overlay [aspect=1]\n",
"(macro_overlay.relabel('GDP Growth', depth=1) +\\\n",
"macro.to.curve('Year', 'Unemployment', ['Country'], group='Unemployment',) +\\\n",
"macro.to.curve('Year', 'Trade', ['Country'], group='Trade') +\\\n",
