{ "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
0balE34.4291804.8854184.4055454.5393874.450754
1balE49.6610329.5784748.5532148.3934907.612073
2balS31.8920042.2825442.5136642.9339442.932558
3balS46.0897075.1219414.7351914.7503304.490810
4imbE34.4082795.3248084.9924805.2048705.410282
5imbE416.71193018.97048619.33707618.06662319.630067
6imbS31.4995611.7722312.4194032.5876372.662647
7imbS45.4813206.1015616.3217076.1308915.906745
8isoE33.3334303.9784684.3809274.6499504.885928
9isoE413.92469814.89125013.39879614.05994213.333687
10isoS31.3892511.5661481.8337141.6928331.982354
11isoS45.3478504.9400555.1970284.4955814.371103
12slcE33.8053105.5536514.7468724.9981435.316813
13slcE416.62356320.35631622.03373421.65909022.218501
14slcS31.3822711.4628561.8558261.9228532.263330
15slcS45.7126595.4262445.0883384.9528414.772914
\n", "
" ], "text/plain": [ "Images Workload Format Strategy 20 40 60 80 \\\n", "0 bal E 3 4.429180 4.885418 4.405545 4.539387 \n", "1 bal E 4 9.661032 9.578474 8.553214 8.393490 \n", "2 bal S 3 1.892004 2.282544 2.513664 2.933944 \n", "3 bal S 4 6.089707 5.121941 4.735191 4.750330 \n", "4 imb E 3 4.408279 5.324808 4.992480 5.204870 \n", "5 imb E 4 16.711930 18.970486 19.337076 18.066623 \n", "6 imb S 3 1.499561 1.772231 2.419403 2.587637 \n", "7 imb S 4 5.481320 6.101561 6.321707 6.130891 \n", "8 iso E 3 3.333430 3.978468 4.380927 4.649950 \n", "9 iso E 4 13.924698 14.891250 13.398796 14.059942 \n", "10 iso S 3 1.389251 1.566148 1.833714 1.692833 \n", "11 iso S 4 5.347850 4.940055 5.197028 4.495581 \n", "12 slc E 3 3.805310 5.553651 4.746872 4.998143 \n", "13 slc E 4 16.623563 20.356316 22.033734 21.659090 \n", "14 slc S 3 1.382271 1.462856 1.855826 1.922853 \n", "15 slc S 4 5.712659 5.426244 5.088338 4.952841 \n", "\n", "Images 100 \n", "0 4.450754 \n", "1 7.612073 \n", "2 2.932558 \n", "3 4.490810 \n", "4 5.410282 \n", "5 19.630067 \n", "6 2.662647 \n", "7 5.906745 \n", "8 4.885928 \n", "9 13.333687 \n", "10 1.982354 \n", "11 4.371103 \n", "12 5.316813 \n", "13 22.218501 \n", "14 2.263330 \n", "15 4.772914 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "subset_data = data[data.Camera == 'inverse']\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.8920042.2825442.5136642.9339442.932558
3balS46.0897075.1219414.7351914.7503304.490810
0balE34.4291804.8854184.4055454.5393874.450754
1balE49.6610329.5784748.5532148.3934907.612073
6imbS31.4995611.7722312.4194032.5876372.662647
7imbS45.4813206.1015616.3217076.1308915.906745
4imbE34.4082795.3248084.9924805.2048705.410282
5imbE416.71193018.97048619.33707618.06662319.630067
14slcS31.3822711.4628561.8558261.9228532.263330
15slcS45.7126595.4262445.0883384.9528414.772914
12slcE33.8053105.5536514.7468724.9981435.316813
13slcE416.62356320.35631622.03373421.65909022.218501
10isoS31.3892511.5661481.8337141.6928331.982354
11isoS45.3478504.9400555.1970284.4955814.371103
8isoE33.3334303.9784684.3809274.6499504.885928
9isoE413.92469814.89125013.39879614.05994213.333687
\n", "
" ], "text/plain": [ "Images Workload Format Strategy 20 40 60 80 \\\n", "2 bal S 3 1.892004 2.282544 2.513664 2.933944 \n", "3 bal S 4 6.089707 5.121941 4.735191 4.750330 \n", "0 bal E 3 4.429180 4.885418 4.405545 4.539387 \n", "1 bal E 4 9.661032 9.578474 8.553214 8.393490 \n", "6 imb S 3 1.499561 1.772231 2.419403 2.587637 \n", "7 imb S 4 5.481320 6.101561 6.321707 6.130891 \n", "4 imb E 3 4.408279 5.324808 4.992480 5.204870 \n", "5 imb E 4 16.711930 18.970486 19.337076 18.066623 \n", "14 slc S 3 1.382271 1.462856 1.855826 1.922853 \n", "15 slc S 4 5.712659 5.426244 5.088338 4.952841 \n", "12 slc E 3 3.805310 5.553651 4.746872 4.998143 \n", "13 slc E 4 16.623563 20.356316 22.033734 21.659090 \n", "10 iso S 3 1.389251 1.566148 1.833714 1.692833 \n", "11 iso S 4 5.347850 4.940055 5.197028 4.495581 \n", "8 iso E 3 3.333430 3.978468 4.380927 4.649950 \n", "9 iso E 4 13.924698 14.891250 13.398796 14.059942 \n", "\n", "Images 100 \n", "2 2.932558 \n", "3 4.490810 \n", "0 4.450754 \n", "1 7.612073 \n", "6 2.662647 \n", "7 5.906745 \n", "4 5.410282 \n", "5 19.630067 \n", "14 2.263330 \n", "15 4.772914 \n", "12 5.316813 \n", "13 22.218501 \n", "10 1.982354 \n", "11 4.371103 \n", "8 4.885928 \n", "9 13.333687 " ] }, "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.8920042.2825442.5136642.9339442.932558
3BalancedStatic46.0897075.1219414.7351914.7503304.490810
0BalancedExplorable34.4291804.8854184.4055454.5393874.450754
1BalancedExplorable49.6610329.5784748.5532148.3934907.612073
6ImbalancedStatic31.4995611.7722312.4194032.5876372.662647
7ImbalancedStatic45.4813206.1015616.3217076.1308915.906745
4ImbalancedExplorable34.4082795.3248084.9924805.2048705.410282
5ImbalancedExplorable416.71193018.97048619.33707618.06662319.630067
14SliceStatic31.3822711.4628561.8558261.9228532.263330
15SliceStatic45.7126595.4262445.0883384.9528414.772914
12SliceExplorable33.8053105.5536514.7468724.9981435.316813
13SliceExplorable416.62356320.35631622.03373421.65909022.218501
10IsosurfaceStatic31.3892511.5661481.8337141.6928331.982354
11IsosurfaceStatic45.3478504.9400555.1970284.4955814.371103
8IsosurfaceExplorable33.3334303.9784684.3809274.6499504.885928
9IsosurfaceExplorable413.92469814.89125013.39879614.05994213.333687
\n", "
" ], "text/plain": [ "Images Workload Type Alg 20 40 60 \\\n", "2 Balanced Static 3 1.892004 2.282544 2.513664 \n", "3 Balanced Static 4 6.089707 5.121941 4.735191 \n", "0 Balanced Explorable 3 4.429180 4.885418 4.405545 \n", "1 Balanced Explorable 4 9.661032 9.578474 8.553214 \n", "6 Imbalanced Static 3 1.499561 1.772231 2.419403 \n", "7 Imbalanced Static 4 5.481320 6.101561 6.321707 \n", "4 Imbalanced Explorable 3 4.408279 5.324808 4.992480 \n", "5 Imbalanced Explorable 4 16.711930 18.970486 19.337076 \n", "14 Slice Static 3 1.382271 1.462856 1.855826 \n", "15 Slice Static 4 5.712659 5.426244 5.088338 \n", "12 Slice Explorable 3 3.805310 5.553651 4.746872 \n", "13 Slice Explorable 4 16.623563 20.356316 22.033734 \n", "10 Isosurface Static 3 1.389251 1.566148 1.833714 \n", "11 Isosurface Static 4 5.347850 4.940055 5.197028 \n", "8 Isosurface Explorable 3 3.333430 3.978468 4.380927 \n", "9 Isosurface Explorable 4 13.924698 14.891250 13.398796 \n", "\n", "Images 80 100 \n", "2 2.933944 2.932558 \n", "3 4.750330 4.490810 \n", "0 4.539387 4.450754 \n", "1 8.393490 7.612073 \n", "6 2.587637 2.662647 \n", "7 6.130891 5.906745 \n", "4 5.204870 5.410282 \n", "5 18.066623 19.630067 \n", "14 1.922853 2.263330 \n", "15 4.952841 4.772914 \n", "12 4.998143 5.316813 \n", "13 21.659090 22.218501 \n", "10 1.692833 1.982354 \n", "11 4.495581 4.371103 \n", "8 4.649950 4.885928 \n", "9 14.059942 13.333687 " ] }, "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.8920041.8920042.2825442.2825442.5136642.5136642.9339442.9339442.9325582.932558
3BalancedStatic46.0897076.0897075.1219415.1219414.7351914.7351914.7503304.7503304.4908104.490810
0BalancedExplorable34.4291804.4291804.8854184.8854184.4055454.4055454.5393874.5393874.4507544.450754
1BalancedExplorable49.6610329.6610329.5784749.5784748.5532148.5532148.3934908.3934907.6120737.612073
6ImbalancedStatic31.4995611.4995611.7722311.7722312.4194032.4194032.5876372.5876372.6626472.662647
7ImbalancedStatic45.4813205.4813206.1015616.1015616.3217076.3217076.1308916.1308915.9067455.906745
4ImbalancedExplorable34.4082794.4082795.3248085.3248084.9924804.9924805.2048705.2048705.4102825.410282
5ImbalancedExplorable416.71193016.71193018.97048618.97048619.33707619.33707618.06662318.06662319.63006719.630067
14SliceStatic31.3822711.3822711.4628561.4628561.8558261.8558261.9228531.9228532.2633302.263330
15SliceStatic45.7126595.7126595.4262445.4262445.0883385.0883384.9528414.9528414.7729144.772914
12SliceExplorable33.8053103.8053105.5536515.5536514.7468724.7468724.9981434.9981435.3168135.316813
13SliceExplorable416.62356316.62356320.35631620.35631622.03373422.03373421.65909021.65909022.21850122.218501
10IsosurfaceStatic31.3892511.3892511.5661481.5661481.8337141.8337141.6928331.6928331.9823541.982354
11IsosurfaceStatic45.3478505.3478504.9400554.9400555.1970285.1970284.4955814.4955814.3711034.371103
8IsosurfaceExplorable33.3334303.3334303.9784683.9784684.3809274.3809274.6499504.6499504.8859284.885928
9IsosurfaceExplorable413.92469813.92469814.89125014.89125013.39879613.39879614.05994214.05994213.33368713.333687
\n", "
" ], "text/plain": [ "Images Workload Type Alg 20 20 40 \\\n", "2 Balanced Static 3 1.892004 1.892004 2.282544 \n", "3 Balanced Static 4 6.089707 6.089707 5.121941 \n", "0 Balanced Explorable 3 4.429180 4.429180 4.885418 \n", "1 Balanced Explorable 4 9.661032 9.661032 9.578474 \n", "6 Imbalanced Static 3 1.499561 1.499561 1.772231 \n", "7 Imbalanced Static 4 5.481320 5.481320 6.101561 \n", "4 Imbalanced Explorable 3 4.408279 4.408279 5.324808 \n", "5 Imbalanced Explorable 4 16.711930 16.711930 18.970486 \n", "14 Slice Static 3 1.382271 1.382271 1.462856 \n", "15 Slice Static 4 5.712659 5.712659 5.426244 \n", "12 Slice Explorable 3 3.805310 3.805310 5.553651 \n", "13 Slice Explorable 4 16.623563 16.623563 20.356316 \n", "10 Isosurface Static 3 1.389251 1.389251 1.566148 \n", "11 Isosurface Static 4 5.347850 5.347850 4.940055 \n", "8 Isosurface Explorable 3 3.333430 3.333430 3.978468 \n", "9 Isosurface Explorable 4 13.924698 13.924698 14.891250 \n", "\n", "Images 40 60 60 80 80 100 \\\n", "2 2.282544 2.513664 2.513664 2.933944 2.933944 2.932558 \n", "3 5.121941 4.735191 4.735191 4.750330 4.750330 4.490810 \n", "0 4.885418 4.405545 4.405545 4.539387 4.539387 4.450754 \n", "1 9.578474 8.553214 8.553214 8.393490 8.393490 7.612073 \n", "6 1.772231 2.419403 2.419403 2.587637 2.587637 2.662647 \n", "7 6.101561 6.321707 6.321707 6.130891 6.130891 5.906745 \n", "4 5.324808 4.992480 4.992480 5.204870 5.204870 5.410282 \n", "5 18.970486 19.337076 19.337076 18.066623 18.066623 19.630067 \n", "14 1.462856 1.855826 1.855826 1.922853 1.922853 2.263330 \n", "15 5.426244 5.088338 5.088338 4.952841 4.952841 4.772914 \n", "12 5.553651 4.746872 4.746872 4.998143 4.998143 5.316813 \n", "13 20.356316 22.033734 22.033734 21.659090 21.659090 22.218501 \n", "10 1.566148 1.833714 1.833714 1.692833 1.692833 1.982354 \n", "11 4.940055 5.197028 5.197028 4.495581 4.495581 4.371103 \n", "8 3.978468 4.380927 4.380927 4.649950 4.649950 4.885928 \n", "9 14.891250 13.398796 13.398796 14.059942 14.059942 13.333687 \n", "\n", "Images 100 \n", "2 2.932558 \n", "3 4.490810 \n", "0 4.450754 \n", "1 7.612073 \n", "6 2.662647 \n", "7 5.906745 \n", "4 5.410282 \n", "5 19.630067 \n", "14 2.263330 \n", "15 4.772914 \n", "12 5.316813 \n", "13 22.218501 \n", "10 1.982354 \n", "11 4.371103 \n", "8 4.885928 \n", "9 13.333687 " ] }, "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": [ "22.218501292934103" ] }, "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.92.32.52.92.9BalancedStatic46.15.14.74.84.5BalancedExplorable34.44.94.44.54.5BalancedExplorable49.79.68.68.47.6ImbalancedStatic31.51.82.42.62.7ImbalancedStatic45.56.16.36.15.9ImbalancedExplorable34.45.35.05.25.4ImbalancedExplorable416.719.019.318.119.6SliceStatic31.41.51.91.92.3SliceStatic45.75.45.15.04.8SliceExplorable33.85.64.75.05.3SliceExplorable416.620.422.021.722.2IsosurfaceStatic31.41.61.81.72.0IsosurfaceStatic45.34.95.24.54.4IsosurfaceExplorable33.34.04.44.64.9IsosurfaceExplorable413.914.913.414.113.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_Inverse_Cinema.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 }