Removed the magics from the Dimensioned Containers user guide
"source": [
"import numpy as np\n",
"import holoviews as hv\n",
+ "from holoviews import opts\n",
"hv.notebook_extension('bokeh')\n",
- "%opts Curve (line_width=1)"
+ "opts.defaults(opts.Curve(line_width=1))"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts Curve [width=600]\n",
"f_carrier = np.linspace(20, 60, 3)\n",
"f_mod = np.linspace(20, 100, 5)\n",
"\n",
"kdims = [hv.Dimension(('f_carrier', 'Carrier frequency'), default=40),\n",
" hv.Dimension(('f_mod', 'Modulation frequency'), default=60)]\n",
"holomap = hv.HoloMap(curve_dict, kdims=kdims)\n",
- "holomap"
+ "holomap.opts(opts.Curve(width=600))"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts GridSpace [plot_size=75] Curve [width=100]\n",
"grid = hv.GridSpace(holomap)\n",
- "grid"
+ "grid.opts(\n",
+ " opts.GridSpace(plot_size=75),\n",
+ " opts.Curve(width=100))"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts Curve [width=500 height=200]\n",
- "hv.NdLayout(grid[20, 20:81]).cols(2)"
+ "ndlayout = hv.NdLayout(grid[20, 20:81])\n",
+ "ndlayout.opts(opts.Curve(width=500, height=200)).cols(2)"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts NdOverlay [width=600 legend_position='right']\n",
- "holomap.overlay('f_carrier')"
+ "holomap.overlay('f_carrier').opts(width=600)"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts Curve [width=200 height=200]\n",
- "holomap.overlay('f_carrier').grid('f_mod')"
+ "gridspace = holomap.overlay('f_carrier').grid('f_mod')\n",
+ "gridspace.opts(opts.Curve(width=200,height=200))"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "%%opts Curve [width=400]\n",
- "holomap[20, 40] + holomap.select(f_carrier=20, f_mod=40)"
+ "layout = holomap[20, 40] + holomap.select(f_carrier=20, f_mod=40)\n",
+ "layout.opts(opts.Curve(width=400))"
]
},
{
