{ "cells": [ { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import toyplot" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [], "source": [ "charts = 6\n", "names = [\"Chart {}\".format(i) for i in range(charts)]\n", "bars = [1.0 for name in names]\n", "data_table = [('Name', names), ('Value', bars)]\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
Example TableNameValueChart 0Chart 1Chart 2Chart 3Chart 4Chart 5
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "canvas = toyplot.Canvas(width=600, height=300)\n", "table = canvas.table(\n", " data_table,\n", " columns=2,\n", " hrows=1,\n", " label=\"Example Table\")\n", "axes = table.body.column(1).merge().axes(xmin=0.0, xmax=1.1)\n", "bar = axes.bars(bars, along='y')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }