{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "This was written with Toyplot 0.13. It definitely won't work with older versions." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.13.0\n" ] } ], "source": [ "import numpy\n", "import pandas\n", "import toyplot.pdf\n", "\n", "print toyplot.__version__" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Read in the data from a csv file." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [], "source": [ "data = pandas.read_csv('All_Compositing_SpeedUp.csv')\n", "#data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Construct the plot for the \"Cinema\" camera." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\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", " \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", " \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", " \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", "
ImagesWorkloadFormatStrategy20406080100
0balE33.8963884.4102573.6931313.6635033.472612
1balE410.7148228.0861186.8725466.1229705.595505
2balS31.5011542.2297092.3670172.6109352.465515
3balS45.4549124.7176073.9834693.7278703.530235
4imbE34.2211205.3275804.7708415.0227034.959440
5imbE414.31362915.69702016.05986816.11979215.729168
6imbS31.4185302.1372472.4223322.6988622.839177
7imbS45.3879546.0689515.7641855.4724835.718200
8isoE33.1497264.1047814.6057364.7884414.968734
9isoE412.48608512.75379812.68215913.16666212.305186
10isoS31.3103791.6746551.8552051.8042352.044277
11isoS45.1394294.7333884.6398984.4078294.074726
12slcE34.0926225.1215123.8301683.7871293.542392
13slcE412.05605910.3242608.3773487.1564946.206197
14slcS31.3144771.8296742.1496552.2384792.318383
15slcS45.1279694.6845314.0054173.5404743.359603
\n", "
" ], "text/plain": [ "Images Workload Format Strategy 20 40 60 80 \\\n", "0 bal E 3 3.896388 4.410257 3.693131 3.663503 \n", "1 bal E 4 10.714822 8.086118 6.872546 6.122970 \n", "2 bal S 3 1.501154 2.229709 2.367017 2.610935 \n", "3 bal S 4 5.454912 4.717607 3.983469 3.727870 \n", "4 imb E 3 4.221120 5.327580 4.770841 5.022703 \n", "5 imb E 4 14.313629 15.697020 16.059868 16.119792 \n", "6 imb S 3 1.418530 2.137247 2.422332 2.698862 \n", "7 imb S 4 5.387954 6.068951 5.764185 5.472483 \n", "8 iso E 3 3.149726 4.104781 4.605736 4.788441 \n", "9 iso E 4 12.486085 12.753798 12.682159 13.166662 \n", "10 iso S 3 1.310379 1.674655 1.855205 1.804235 \n", "11 iso S 4 5.139429 4.733388 4.639898 4.407829 \n", "12 slc E 3 4.092622 5.121512 3.830168 3.787129 \n", "13 slc E 4 12.056059 10.324260 8.377348 7.156494 \n", "14 slc S 3 1.314477 1.829674 2.149655 2.238479 \n", "15 slc S 4 5.127969 4.684531 4.005417 3.540474 \n", "\n", "Images 100 \n", "0 3.472612 \n", "1 5.595505 \n", "2 2.465515 \n", "3 3.530235 \n", "4 4.959440 \n", "5 15.729168 \n", "6 2.839177 \n", "7 5.718200 \n", "8 4.968734 \n", "9 12.305186 \n", "10 2.044277 \n", "11 4.074726 \n", "12 3.542392 \n", "13 6.206197 \n", "14 2.318383 \n", "15 3.359603 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "subset_data = data[data.Camera == 'Surface']\n", "subset_data = subset_data[subset_data.Strategy >= 3]\n", "plot_data = subset_data.pivot_table(index=['Workload','Format','Strategy'],\n", " columns='Images',\n", " values='Speedup')\n", "plot_data.reset_index(inplace=True)\n", "plot_data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Change order of entries." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\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", " \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", " \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", " \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", "
ImagesWorkloadFormatStrategy20406080100
2balS31.5011542.2297092.3670172.6109352.465515
3balS45.4549124.7176073.9834693.7278703.530235
0balE33.8963884.4102573.6931313.6635033.472612
1balE410.7148228.0861186.8725466.1229705.595505
6imbS31.4185302.1372472.4223322.6988622.839177
7imbS45.3879546.0689515.7641855.4724835.718200
4imbE34.2211205.3275804.7708415.0227034.959440
5imbE414.31362915.69702016.05986816.11979215.729168
14slcS31.3144771.8296742.1496552.2384792.318383
15slcS45.1279694.6845314.0054173.5404743.359603
12slcE34.0926225.1215123.8301683.7871293.542392
13slcE412.05605910.3242608.3773487.1564946.206197
10isoS31.3103791.6746551.8552051.8042352.044277
11isoS45.1394294.7333884.6398984.4078294.074726
8isoE33.1497264.1047814.6057364.7884414.968734
9isoE412.48608512.75379812.68215913.16666212.305186
\n", "
" ], "text/plain": [ "Images Workload Format Strategy 20 40 60 80 \\\n", "2 bal S 3 1.501154 2.229709 2.367017 2.610935 \n", "3 bal S 4 5.454912 4.717607 3.983469 3.727870 \n", "0 bal E 3 3.896388 4.410257 3.693131 3.663503 \n", "1 bal E 4 10.714822 8.086118 6.872546 6.122970 \n", "6 imb S 3 1.418530 2.137247 2.422332 2.698862 \n", "7 imb S 4 5.387954 6.068951 5.764185 5.472483 \n", "4 imb E 3 4.221120 5.327580 4.770841 5.022703 \n", "5 imb E 4 14.313629 15.697020 16.059868 16.119792 \n", "14 slc S 3 1.314477 1.829674 2.149655 2.238479 \n", "15 slc S 4 5.127969 4.684531 4.005417 3.540474 \n", "12 slc E 3 4.092622 5.121512 3.830168 3.787129 \n", "13 slc E 4 12.056059 10.324260 8.377348 7.156494 \n", "10 iso S 3 1.310379 1.674655 1.855205 1.804235 \n", "11 iso S 4 5.139429 4.733388 4.639898 4.407829 \n", "8 iso E 3 3.149726 4.104781 4.605736 4.788441 \n", "9 iso E 4 12.486085 12.753798 12.682159 13.166662 \n", "\n", "Images 100 \n", "2 2.465515 \n", "3 3.530235 \n", "0 3.472612 \n", "1 5.595505 \n", "6 2.839177 \n", "7 5.718200 \n", "4 4.959440 \n", "5 15.729168 \n", "14 2.318383 \n", "15 3.359603 \n", "12 3.542392 \n", "13 6.206197 \n", "10 2.044277 \n", "11 4.074726 \n", "8 4.968734 \n", "9 12.305186 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "plot_data.Format = plot_data.Format.astype('category')\n", "plot_data.Format.cat.set_categories(['S','E'], inplace=True)\n", "plot_data.Workload = plot_data.Workload.astype('category')\n", "plot_data.Workload.cat.set_categories(['bal','imb','slc','iso'], inplace=True)\n", "plot_data.sort_values(['Workload', 'Format', 'Strategy'], inplace=True)\n", "plot_data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Change the values to printable names." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\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", " \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", " \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", " \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", "
ImagesWorkloadTypeAlg20406080100
2BalancedStatic31.5011542.2297092.3670172.6109352.465515
3BalancedStatic45.4549124.7176073.9834693.7278703.530235
0BalancedExplorable33.8963884.4102573.6931313.6635033.472612
1BalancedExplorable410.7148228.0861186.8725466.1229705.595505
6ImbalancedStatic31.4185302.1372472.4223322.6988622.839177
7ImbalancedStatic45.3879546.0689515.7641855.4724835.718200
4ImbalancedExplorable34.2211205.3275804.7708415.0227034.959440
5ImbalancedExplorable414.31362915.69702016.05986816.11979215.729168
14SliceStatic31.3144771.8296742.1496552.2384792.318383
15SliceStatic45.1279694.6845314.0054173.5404743.359603
12SliceExplorable34.0926225.1215123.8301683.7871293.542392
13SliceExplorable412.05605910.3242608.3773487.1564946.206197
10IsosurfaceStatic31.3103791.6746551.8552051.8042352.044277
11IsosurfaceStatic45.1394294.7333884.6398984.4078294.074726
8IsosurfaceExplorable33.1497264.1047814.6057364.7884414.968734
9IsosurfaceExplorable412.48608512.75379812.68215913.16666212.305186
\n", "
" ], "text/plain": [ "Images Workload Type Alg 20 40 60 \\\n", "2 Balanced Static 3 1.501154 2.229709 2.367017 \n", "3 Balanced Static 4 5.454912 4.717607 3.983469 \n", "0 Balanced Explorable 3 3.896388 4.410257 3.693131 \n", "1 Balanced Explorable 4 10.714822 8.086118 6.872546 \n", "6 Imbalanced Static 3 1.418530 2.137247 2.422332 \n", "7 Imbalanced Static 4 5.387954 6.068951 5.764185 \n", "4 Imbalanced Explorable 3 4.221120 5.327580 4.770841 \n", "5 Imbalanced Explorable 4 14.313629 15.697020 16.059868 \n", "14 Slice Static 3 1.314477 1.829674 2.149655 \n", "15 Slice Static 4 5.127969 4.684531 4.005417 \n", "12 Slice Explorable 3 4.092622 5.121512 3.830168 \n", "13 Slice Explorable 4 12.056059 10.324260 8.377348 \n", "10 Isosurface Static 3 1.310379 1.674655 1.855205 \n", "11 Isosurface Static 4 5.139429 4.733388 4.639898 \n", "8 Isosurface Explorable 3 3.149726 4.104781 4.605736 \n", "9 Isosurface Explorable 4 12.486085 12.753798 12.682159 \n", "\n", "Images 80 100 \n", "2 2.610935 2.465515 \n", "3 3.727870 3.530235 \n", "0 3.663503 3.472612 \n", "1 6.122970 5.595505 \n", "6 2.698862 2.839177 \n", "7 5.472483 5.718200 \n", "4 5.022703 4.959440 \n", "5 16.119792 15.729168 \n", "14 2.238479 2.318383 \n", "15 3.540474 3.359603 \n", "12 3.787129 3.542392 \n", "13 7.156494 6.206197 \n", "10 1.804235 2.044277 \n", "11 4.407829 4.074726 \n", "8 4.788441 4.968734 \n", "9 13.166662 12.305186 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "plot_data.Workload = plot_data.Workload.map({'bal': 'Balanced',\n", " 'imb': 'Imbalanced',\n", " 'slc': 'Slice',\n", " 'iso': 'Isosurface'})\n", "plot_data.Format = plot_data.Format.map({'S': 'Static', 'E': 'Explorable'})\n", "plot_data.rename(index=str, columns={'Strategy': 'Alg'}, inplace=True)\n", "plot_data.rename(index=str, columns={'Format': 'Type'}, inplace=True)\n", "plot_data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Duplicate value columns to put in bar chart." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\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", " \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", " \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", " \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", " \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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ImagesWorkloadTypeAlg2020404060608080100100
2BalancedStatic31.5011541.5011542.2297092.2297092.3670172.3670172.6109352.6109352.4655152.465515
3BalancedStatic45.4549125.4549124.7176074.7176073.9834693.9834693.7278703.7278703.5302353.530235
0BalancedExplorable33.8963883.8963884.4102574.4102573.6931313.6931313.6635033.6635033.4726123.472612
1BalancedExplorable410.71482210.7148228.0861188.0861186.8725466.8725466.1229706.1229705.5955055.595505
6ImbalancedStatic31.4185301.4185302.1372472.1372472.4223322.4223322.6988622.6988622.8391772.839177
7ImbalancedStatic45.3879545.3879546.0689516.0689515.7641855.7641855.4724835.4724835.7182005.718200
4ImbalancedExplorable34.2211204.2211205.3275805.3275804.7708414.7708415.0227035.0227034.9594404.959440
5ImbalancedExplorable414.31362914.31362915.69702015.69702016.05986816.05986816.11979216.11979215.72916815.729168
14SliceStatic31.3144771.3144771.8296741.8296742.1496552.1496552.2384792.2384792.3183832.318383
15SliceStatic45.1279695.1279694.6845314.6845314.0054174.0054173.5404743.5404743.3596033.359603
12SliceExplorable34.0926224.0926225.1215125.1215123.8301683.8301683.7871293.7871293.5423923.542392
13SliceExplorable412.05605912.05605910.32426010.3242608.3773488.3773487.1564947.1564946.2061976.206197
10IsosurfaceStatic31.3103791.3103791.6746551.6746551.8552051.8552051.8042351.8042352.0442772.044277
11IsosurfaceStatic45.1394295.1394294.7333884.7333884.6398984.6398984.4078294.4078294.0747264.074726
8IsosurfaceExplorable33.1497263.1497264.1047814.1047814.6057364.6057364.7884414.7884414.9687344.968734
9IsosurfaceExplorable412.48608512.48608512.75379812.75379812.68215912.68215913.16666213.16666212.30518612.305186
\n", "
" ], "text/plain": [ "Images Workload Type Alg 20 20 40 \\\n", "2 Balanced Static 3 1.501154 1.501154 2.229709 \n", "3 Balanced Static 4 5.454912 5.454912 4.717607 \n", "0 Balanced Explorable 3 3.896388 3.896388 4.410257 \n", "1 Balanced Explorable 4 10.714822 10.714822 8.086118 \n", "6 Imbalanced Static 3 1.418530 1.418530 2.137247 \n", "7 Imbalanced Static 4 5.387954 5.387954 6.068951 \n", "4 Imbalanced Explorable 3 4.221120 4.221120 5.327580 \n", "5 Imbalanced Explorable 4 14.313629 14.313629 15.697020 \n", "14 Slice Static 3 1.314477 1.314477 1.829674 \n", "15 Slice Static 4 5.127969 5.127969 4.684531 \n", "12 Slice Explorable 3 4.092622 4.092622 5.121512 \n", "13 Slice Explorable 4 12.056059 12.056059 10.324260 \n", "10 Isosurface Static 3 1.310379 1.310379 1.674655 \n", "11 Isosurface Static 4 5.139429 5.139429 4.733388 \n", "8 Isosurface Explorable 3 3.149726 3.149726 4.104781 \n", "9 Isosurface Explorable 4 12.486085 12.486085 12.753798 \n", "\n", "Images 40 60 60 80 80 100 \\\n", "2 2.229709 2.367017 2.367017 2.610935 2.610935 2.465515 \n", "3 4.717607 3.983469 3.983469 3.727870 3.727870 3.530235 \n", "0 4.410257 3.693131 3.693131 3.663503 3.663503 3.472612 \n", "1 8.086118 6.872546 6.872546 6.122970 6.122970 5.595505 \n", "6 2.137247 2.422332 2.422332 2.698862 2.698862 2.839177 \n", "7 6.068951 5.764185 5.764185 5.472483 5.472483 5.718200 \n", "4 5.327580 4.770841 4.770841 5.022703 5.022703 4.959440 \n", "5 15.697020 16.059868 16.059868 16.119792 16.119792 15.729168 \n", "14 1.829674 2.149655 2.149655 2.238479 2.238479 2.318383 \n", "15 4.684531 4.005417 4.005417 3.540474 3.540474 3.359603 \n", "12 5.121512 3.830168 3.830168 3.787129 3.787129 3.542392 \n", "13 10.324260 8.377348 8.377348 7.156494 7.156494 6.206197 \n", "10 1.674655 1.855205 1.855205 1.804235 1.804235 2.044277 \n", "11 4.733388 4.639898 4.639898 4.407829 4.407829 4.074726 \n", "8 4.104781 4.605736 4.605736 4.788441 4.788441 4.968734 \n", "9 12.753798 12.682159 12.682159 13.166662 13.166662 12.305186 \n", "\n", "Images 100 \n", "2 2.465515 \n", "3 3.530235 \n", "0 3.472612 \n", "1 5.595505 \n", "6 2.839177 \n", "7 5.718200 \n", "4 4.959440 \n", "5 15.729168 \n", "14 2.318383 \n", "15 3.359603 \n", "12 3.542392 \n", "13 6.206197 \n", "10 2.044277 \n", "11 4.074726 \n", "8 4.968734 \n", "9 12.305186 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "plot_data.insert(4, 20, plot_data[20], allow_duplicates=True)\n", "plot_data.insert(6, 40, plot_data[40], allow_duplicates=True)\n", "plot_data.insert(8, 60, plot_data[60], allow_duplicates=True)\n", "plot_data.insert(10, 80, plot_data[80], allow_duplicates=True)\n", "plot_data.insert(12, 100, plot_data[100], allow_duplicates=True)\n", "plot_data" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "16.1197917608796" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max_value = plot_data.max()[3:].max()\n", "max_value" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
WorkloadTypeAlgBalancedStatic31.52.22.42.62.5BalancedStatic45.54.74.03.73.5BalancedExplorable33.94.43.73.73.5BalancedExplorable410.78.16.96.15.6ImbalancedStatic31.42.12.42.72.8ImbalancedStatic45.46.15.85.55.7ImbalancedExplorable34.25.34.85.05.0ImbalancedExplorable414.315.716.116.115.7SliceStatic31.31.82.12.22.3SliceStatic45.14.74.03.53.4SliceExplorable34.15.13.83.83.5SliceExplorable412.110.38.47.26.2IsosurfaceStatic31.31.71.91.82.0IsosurfaceStatic45.14.74.64.44.1IsosurfaceExplorable33.14.14.64.85.0IsosurfaceExplorable412.512.812.713.212.320 Images40 Images60 Images80 Images100 Images
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "canvas = toyplot.Canvas(width=900, height=420)\n", "table = canvas.table(plot_data)\n", "table.cells.cell[:,3:].format = toyplot.format.FloatFormatter(format='{:.1f}')\n", "\n", "# Generally I do not want vertical lines, but they can be handy when resizing columns.\n", "#table.grid.vlines[...] = \"single\"\n", "\n", "table.column(0).width = 72\n", "table.column(1).width = 70\n", "table.column(2).width = 25\n", "table.column(3).width = 30\n", "table.column(3).column_offset = 8\n", "table.column(5).width = 30\n", "table.column(5).column_offset = 8\n", "table.column(7).width = 30\n", "table.column(7).column_offset = 8\n", "table.column(9).width = 30\n", "table.column(9).column_offset = 8\n", "table.column(11).width = 30\n", "table.column(11).column_offset = 8\n", "\n", "# Left align the text in cells, center algorithm number\n", "table.body.cell[:, 0:2].align = 'left'\n", "table.body.cell[:, 2].align = 'center'\n", "\n", "# Merge header for numbers and bar chart\n", "table.top.cell[0,3:5].merge().data = \"20 Images\"\n", "table.top.cell[0,5:7].merge().data = \"40 Images\"\n", "table.top.cell[0,7:9].merge().data = \"60 Images\"\n", "table.top.cell[0,9:11].merge().data = \"80 Images\"\n", "table.top.cell[0,11:13].merge().data = \"100 Images\"\n", "\n", "# Make bar chart columns\n", "axes = table.body.column[4].cartesian()\n", "axes.cell_bars(width=1)\n", "axes.x.domain.max = max_value\n", "\n", "axes = table.body.column[6].cartesian()\n", "axes.cell_bars(width=1)\n", "axes.x.domain.max = max_value\n", "\n", "axes = table.body.column[8].cartesian()\n", "axes.cell_bars(width=1)\n", "axes.x.domain.max = max_value\n", "\n", "axes = table.body.column[10].cartesian()\n", "axes.cell_bars(width=1)\n", "axes.x.domain.max = max_value\n", "\n", "axes = table.body.column[12].cartesian()\n", "axes.cell_bars(width=1)\n", "axes.x.domain.max = max_value\n", "\n", "# Add gaps to separate groups\n", "table.body.gaps.rows[[3,7,11]] = '6pt'\n", "table.body.gaps.rows[[1,5,9,13]] = '3pt'" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": true }, "outputs": [], "source": [ "toyplot.pdf.render(canvas, 'Compositing_SpeedUp_Surface_Reconstruct.pdf')" ] } ], "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.11" } }, "nbformat": 4, "nbformat_minor": 0 }