Make a plot showing contributions of properties to a PC
510416
def make_contribplot(self, pc_to_look_at=1, sigadder=0.01, outpath=None, dpi=150, return_top_contribs=False):
        """"""
        cont = pd.DataFrame(self.pca.components_, columns=self.features_df.index, index=self.pc_names_list)
        tmp_df = pd.DataFrame(cont.iloc[pc_to_look_at - 1]).reset_index().rename(columns={'index': 'Property'})
        tmp_df['Contribution'] = tmp_df.iloc[:, 1] ** 2
        tmp_df = tmp_df[tmp_df['Contribution'] > 1 / len(
                cont.iloc[0]) + sigadder]  # Alter sigadder to just plot more/less significant contributors
        tmp_df['Sign'] = np.where(tmp_df.iloc[:, 1] >= 0, 'Positive', 'Negative')
        tmp_df = tmp_df.sort_values(by='Contribution', ascending=False)

        fig, ax = plt.subplots(figsize=(30, 10))
        sns.barplot(data=tmp_df, y='Property', x='Contribution', hue='Sign', dodge=False, ax=ax, hue_order=['Positive', 'Negative'],
                        palette=sns.color_palette("coolwarm", 2))

        # Random formatting crap
        self._change_height(ax, .6)  # Make bars thinner
        ax.set_title('{} contributors'.format(self.pc_names_list[pc_to_look_at - 1]))
        legend = plt.legend(loc=8, bbox_to_anchor=(1.2, .8), ncol=1, title='Sign', fontsize=10)
        plt.setp(legend.get_title(), fontsize=12)
        plt.gcf().subplots_adjust(left=.5, right=.65)
        if outpath:
            fig.savefig(outpath, dpi=dpi)
        else:
            plt.show()
        plt.close()

        if return_top_contribs:
            return tmp_df.Property.values.tolist()
1326430
def _plot_extension(self, gta, prefix, src, loge_bounds=None, **kwargs):
        """"""

        # format = kwargs.get('format', self.config['plotting']['format'])

        if loge_bounds is None:
            loge_bounds = (self.energies[0], self.energies[-1])

        name = src['name'].lower().replace(' ', '_')

        esuffix = '_%.3f_%.3f' % (loge_bounds[0], loge_bounds[1])

        p = ExtensionPlotter(src, self.roi, '',
                             self.config['fileio']['workdir'],
                             loge_bounds=loge_bounds)

        fig = plt.figure()
        p.plot(0)
        plt.gca().set_xlim(-2, 2)
        ROIPlotter.setup_projection_axis(0)
        annotate(src=src, loge_bounds=loge_bounds)
        plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                 '%s_%s_extension_xproj%s.png' % (
                                     prefix, name, esuffix)))
        plt.close(fig)

        fig = plt.figure()
        p.plot(1)
        plt.gca().set_xlim(-2, 2)
        ROIPlotter.setup_projection_axis(1)
        annotate(src=src, loge_bounds=loge_bounds)
        plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                 '%s_%s_extension_yproj%s.png' % (
                                     prefix, name, esuffix)))
        plt.close(fig)

        for i, c in enumerate(self.components):
            suffix = '_%02i' % i

            p = ExtensionPlotter(src, self.roi, suffix,
                                 self.config['fileio']['workdir'],
                                 loge_bounds=loge_bounds)

            fig = plt.figure()
            p.plot(0)
            ROIPlotter.setup_projection_axis(0, loge_bounds=loge_bounds)
            annotate(src=src, loge_bounds=loge_bounds)
            plt.gca().set_xlim(-2, 2)
            plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                     '%s_%s_extension_xproj%s%s.png' % (
                                         prefix, name, esuffix, suffix)))
            plt.close(fig)

            fig = plt.figure()
            p.plot(1)
            plt.gca().set_xlim(-2, 2)
            ROIPlotter.setup_projection_axis(1, loge_bounds=loge_bounds)
            annotate(src=src, loge_bounds=loge_bounds)
            plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                     '%s_%s_extension_yproj%s%s.png' % (
                                         prefix, name, esuffix, suffix)))
            plt.close(fig)
1347256
def plot_clicked(self, event):
        """"""
        flip = False
        choose = False
        zoom = False
        replot = False
        items = self.win.scene().items(event.scenePos())
        posx = 0
        posy = 0
        iplot = 0
        if self.loaded:
            # print(event.modifiers() == QtCore.Qt.ControlModifier)
            for x in items:
                if x == self.p0:
                    if self.embedded:
                        iplot = 0
                        vb = self.p0.vb
                        pos = vb.mapSceneToView(event.scenePos())
                        x = pos.x()
                        y = pos.y()
                        if event.double():
                            self.zoom_plot(iplot)
                        elif event.button() == 2:
                            # do nothing
                            nothing = True
                        elif event.modifiers() == QtCore.Qt.ShiftModifier:
                            if not self.startROI:
                                self.startROI = True
                                self.endROI = False
                                self.posROI[0,:] = [x,y]
                            else:
                                # plotting
                                self.startROI = True
                                self.endROI = False
                                self.posROI[1,:] = [x,y]
                                #print(self.)
                                self.posAll.append(self.posROI[:2,:].copy())
                                pos = self.posAll[-1]
                                self.lp.append(pg.PlotDataItem(pos[:, 0], pos[:, 1]))
                                self.posROI[0,:] = [x,y]
                                self.p0.addItem(self.lp[-1])
                                self.p0.show()
                        elif self.startROI:
                            self.posROI[1,:] = [x,y]
                            self.posAll.append(self.posROI[:2,:].copy())
                            self.p0.removeItem(self.l0)
                            pos = self.posAll[-1]
                            self.lp.append(pg.PlotDataItem(pos[:, 0], pos[:, 1]))
                            self.p0.addItem(self.lp[-1])
                            self.p0.show()
                            self.endROI = True
                            self.startROI = False
                        elif self.endROI:
                            self.posROI[2,:] = [x,y]
                            self.endROI = False
                            for lp in self.lp:
                                self.p0.removeItem(lp)
                            self.ROI_add(self.posAll, self.prect)
                            self.posAll = []
                            self.lp = []

                        elif event.modifiers() == QtCore.Qt.AltModifier:
                            self.ROI_remove([x,y])

                elif x == self.p1:
                    iplot = 1
                    y = self.p1.vb.mapSceneToView(event.scenePos()).y()
                    ineur = min(self.colormat.shape[0]-1, max(0, int(np.floor(y))))
                    ineur = ineur + self.yrange[0]
                    if event.double():
                        self.zoom_plot(iplot)
                    elif event.modifiers() == QtCore.Qt.AltModifier:
                        self.ROI_remove([ineur])
                elif x == self.p3:
                    iplot = 2
                    y = self.p3.vb.mapSceneToView(event.scenePos()).y()
                    ineur = min(self.colormat.shape[0]-1, max(0, int(np.floor(y))))
                    if event.modifiers() == QtCore.Qt.AltModifier:
                        self.ROI_remove([ineur])
15326
def plot_or_print(example_farm, example_cluster):
    

    """

    # plot or print power output
    if plt:
        example_cluster.power_output.plot(legend=True, label='example cluster')
        example_farm.power_output.plot(legend=True, label='example farm')
        plt.show()
    else:
        print(example_cluster.power_output)
        print(example_farm.power_output)
813936
def plotit(self):
        '''
        
        '''
        [self._plot(i) for i in range(len(self.plots))]
875056
def plotMultipleInferenceRun(stats,
                       fields,
                       basename,
                       plotDir="plots"):
  
  if not os.path.exists(plotDir):
    os.makedirs(plotDir)

  plt.figure()

  colorList = ['r', 'b', 'g', 'm', 'c', 'k', 'y']

  # plot request stats
  for i, field in enumerate(fields):
    fieldKey = field[0] + " C0"
    trace = []
    for s in stats:
      trace += s[fieldKey]
    plt.plot(trace, label=field[1], color=colorList[i])

  # format
  plt.legend(loc="upper right")
  plt.xlabel("Input number")
  plt.xticks(range(0, len(stats)*stats[0]["numSteps"]+1,5))
  plt.ylabel("Number of cells")
  plt.ylim(-5, 55)
  plt.title("Inferring combined sensorimotor and temporal sequence stream")

  # save
  relPath = "{}_exp_combined.pdf".format(basename)
  path = os.path.join(plotDir, relPath)
  plt.savefig(path)
  plt.close()
278801
def hicexplorer_create_plot(self, pKeyList, pTitle, pId):
        """"""

        keys = OrderedDict()

        for i, key_ in enumerate(pKeyList):
            keys[key_] = {'color': self.colors[i]}

        data = {}

        for data_ in self.mod_data:
            data['{}'.format(self.mod_data[data_]['File'][0])] = {}
            for key_ in pKeyList:
                data['{}'.format(self.mod_data[data_]['File'][0])][key_] = self.mod_data[data_][key_][0]

        config = {
            'id': 'hicexplorer_' + pId + '_plot',
            'title': pTitle,
            'ylab': 'Number of Reads',
            'cpswitch_counts_label': 'Number of Reads'
        }

        return bargraph.plot(data, keys, config)
743166
def plot_result(x_p, y_p, y_p_e, smoothed_data, smoothed_data_diff, filename=None):
    ''' 
    '''
    logging.info('Plot results')
    plt.close()

    p1 = plt.errorbar(x_p * analysis_configuration['vcal_calibration'], y_p, yerr=y_p_e, fmt='o')  # plot data with error bars
    p2, = plt.plot(x_p * analysis_configuration['vcal_calibration'], smoothed_data, '-r')  # plot smoothed data
    factor = np.amax(y_p) / np.amin(smoothed_data_diff) * 1.1
    p3, = plt.plot(x_p * analysis_configuration['vcal_calibration'], factor * smoothed_data_diff, '-', lw=2)  # plot differentiated data
    mpv_index = np.argmax(-analysis_utils.smooth_differentiation(x_p, y_p, weigths=1 / y_p_e, order=3, smoothness=analysis_configuration['smoothness'], derivation=1))
    p4, = plt.plot([x_p[mpv_index] * analysis_configuration['vcal_calibration'], x_p[mpv_index] * analysis_configuration['vcal_calibration']], [0, factor * smoothed_data_diff[mpv_index]], 'k-', lw=2)
    text = 'MPV ' + str(int(x_p[mpv_index] * analysis_configuration['vcal_calibration'])) + ' e'
    plt.text(1.01 * x_p[mpv_index] * analysis_configuration['vcal_calibration'], -10. * smoothed_data_diff[mpv_index], text, ha='left')
    plt.legend([p1, p2, p3, p4], ['data', 'smoothed spline', 'spline differentiation', text], prop={'size': 12}, loc=0)
    plt.title('\'Single hit cluster\'-occupancy for different pixel thresholds')
    plt.xlabel('Pixel threshold [e]')
    plt.ylabel('Single hit cluster occupancy [a.u.]')
    plt.ylim(0, np.amax(y_p) * 1.15)
    if filename is None:
        plt.show()
    else:
        filename.savefig(plt.gcf())
    return smoothed_data_diff
1103640
def _plot(self, xticks=[], yticks=[], minor_xticks=[], minor_yticks=[],
              xlabel='Longitude', ylabel='Latitude', ax=None, ax2=None,
              colorbar=None, cb_orientation=None, cb_label=None, grid=False,
              axes_labelsize=None, tick_labelsize=None, **kwargs):
        """"""

        if ax is None:
            if colorbar is True:
                if cb_orientation == 'horizontal':
                    scale = 0.67
                else:
                    scale = 0.5
            else:
                scale = 0.55
            figsize = (_mpl.rcParams['figure.figsize'][0],
                       _mpl.rcParams['figure.figsize'][0] * scale)
            fig, axes = _plt.subplots(1, 1, figsize=figsize)
        else:
            axes = ax

        deg = '$^{\circ}$'
        xticklabels = [str(int(y)) + deg for y in xticks]
        yticklabels = [str(int(y)) + deg for y in yticks]

        cim = axes.imshow(self.data, origin='upper',
                          extent=(0., 360., -90., 90.), **kwargs)
        axes.set(xticks=xticks, yticks=yticks)
        axes.set_xlabel(xlabel, fontsize=axes_labelsize)
        axes.set_ylabel(ylabel, fontsize=axes_labelsize)
        axes.set_xticklabels(xticklabels, fontsize=tick_labelsize)
        axes.set_yticklabels(yticklabels, fontsize=tick_labelsize)
        axes.set_xticks(minor_xticks, minor=True)
        axes.set_yticks(minor_yticks, minor=True)
        axes.grid(grid, which='major')

        if colorbar is True:
            if cb_orientation == 'vertical':
                divider = _make_axes_locatable(axes)
                cax = divider.append_axes("right", size="2.5%", pad=0.15)
                cbar = _plt.colorbar(cim, cax=cax, orientation=cb_orientation)
            else:
                divider = _make_axes_locatable(axes)
                cax = divider.append_axes("bottom", size="5%", pad=0.5)
                cbar = _plt.colorbar(cim, cax=cax,
                                     orientation=cb_orientation)
            if cb_label is not None:
                cbar.set_label(cb_label, fontsize=axes_labelsize)
            cbar.ax.tick_params(labelsize=tick_labelsize)

        if ax is None:
            return fig, axes
813930
function visualizeOutputs(
    partId, drawHeatmaps, drawOffsetVectors, drawDisplacements, ctx) {
  const {heatmapScores, offsets, displacementFwd, displacementBwd} =
      modelOutputs;
  const outputStride = +guiState.outputStride;

  const [height, width] = heatmapScores.shape;

  ctx.globalAlpha = 0;
  const heatmapScoresArr = heatmapScores.arraySync();
  const offsetsArr = offsets.arraySync();

  for (let y = 0; y < height; y++) {
    for (let x = 0; x < width; x++) {
      const score = heatmapScoresArr[y][x][partId];

      // to save on performance, don't draw anything with a low score.
      if (score < 0.05) continue;

      // set opacity of drawn elements based on the score
      ctx.globalAlpha = score;

      if (drawHeatmaps) {
        drawPoint(ctx, y * outputStride, x * outputStride, 2, 'yellow');
      }

      const offsetsVectorY = offsetsArr[y][x][partId];
      const offsetsVectorX = offsetsArr[y][x][partId + 17];

      if (drawOffsetVectors) {
        drawOffsetVector(
            ctx, y, x, outputStride, offsetsVectorY, offsetsVectorX);
      }

      if (drawDisplacements) {
        // exponentially affect the alpha of the displacements;
        ctx.globalAlpha *= score;

        drawDisplacementEdgesFrom(
            ctx, partId, displacementFwd, outputStride, parentToChildEdges, y,
            x, offsetsVectorY, offsetsVectorX);

        drawDisplacementEdgesFrom(
            ctx, partId, displacementBwd, outputStride, childToParentEdges, y,
            x, offsetsVectorY, offsetsVectorX);
      }
    }

    ctx.globalAlpha = 1;
  }
}
873152
def main():
    
    allowed_format = ("emf", "eps", "pdf", "png", "ps", \
                      "raw", "rgba", "svg", "svgz")
    p = OptionParser(main.__doc__)
    p.add_option("--skip", default=0, type="int",
            help="skip the first several lines [default: %default]")
    p.add_option("--col", default=0, type="int", help="Get the n-th column")
    p.set_histogram()
    p.add_option("--tags", dest="tags", default=None,
            help="tags for data if multiple input files, comma sep")
    p.add_option("--ascii", default=False, action="store_true",
            help="print ASCII text stem-leaf plot [default: %default]")
    p.add_option("--base", default="0", choices=("0", "2", "10"),
            help="use logarithm axis with base, 0 to disable [default: %default]")
    p.add_option("--facet", default=False, action="store_true",
            help="place multiple histograms side-by-side [default: %default]")
    p.add_option("--fill", default="white",
            help="color of the bin [default: %default]")
    p.add_option("--format", default="pdf", choices=allowed_format,
            help="Generate image of format [default: %default]")
    p.add_option("--quick", default=False, action="store_true",
            help="Use quick plot, assuming bins are already counted")
    p.add_option("--noprintstats", default=False, action="store_true",
            help="Write basic stats when using --quick")
    opts, args = p.parse_args()

    if len(args) < 1:
        sys.exit(not p.print_help())

    skip = opts.skip
    vmin, vmax = opts.vmin, opts.vmax
    bins = opts.bins
    xlabel, title = opts.xlabel, opts.title
    title = title or args[0]
    base = int(opts.base)
    fileno = len(args)

    if opts.quick:
        assert fileno == 1, "Single input file expected using --quick"
        filename = args[0]
        figname = filename.rsplit(".", 1)[0] + ".pdf"
        data = DictFile(filename, keycast=int, cast=int)
        quickplot(data, vmin, vmax, xlabel, title, figname=figname,
                  print_stats=(not opts.noprintstats))
        return

    if fileno == 1:
        histogram(args[0], vmin, vmax, xlabel, title, outfmt=opts.format,
                bins=bins, skip=skip, ascii=opts.ascii,
                base=base, fill=opts.fill, col=opts.col)
    else:
        histogram_multiple(args, vmin, vmax, xlabel, title, outfmt=opts.format,
                tags=opts.tags, bins=bins, skip=skip, ascii=opts.ascii,
                facet=opts.facet, fill=opts.fill)
211554
def _plot(self):
        """"""
        total = sum(map(sum, map(lambda x: x.values, self.series)))
        if total == 0:
            return
        if self.half_pie:
            current_angle = 3 * pi / 2
        else:
            current_angle = 0

        for index, serie in enumerate(self.series):
            angle = self.slice(serie, current_angle, total)
            current_angle += angle
1274040
def generate_graphs(data_frames, hardware_info, steps, outdir,
                    verbose=False):
    """"""
    _setup_matplotlib()
    # Hash of hosts containing (data, hardware, steps) tuple
    collectl_info = collections.defaultdict(dict)

    for host, data_frame in data_frames.items():
        if verbose:
            print('Generating CPU graph for {}...'.format(host))
        graph, data_cpu = graph_cpu(data_frame, steps, hardware_info[host]['num_cpus'])

        graph.get_figure().savefig(
            os.path.join(outdir, '{}_cpu.png'.format(host)),
            bbox_inches='tight', pad_inches=0.25)
        pylab.close()

        ifaces = set([series.split('_')[0]
                      for series in data_frame.keys()
                      if series.startswith(('eth', 'ib'))])

        if verbose:
            print('Generating network graphs for {}...'.format(host))
        graph, data_net_bytes = graph_net_bytes(data_frame, steps, ifaces)
        graph.get_figure().savefig(
            os.path.join(outdir, '{}_net_bytes.png'.format(host)),
            bbox_inches='tight', pad_inches=0.25)
        pylab.close()

        graph, data_net_pkts = graph_net_pkts(data_frame, steps, ifaces)
        graph.get_figure().savefig(
            os.path.join(outdir, '{}_net_pkts.png'.format(host)),
            bbox_inches='tight', pad_inches=0.25)
        pylab.close()

        if verbose:
            print('Generating memory graph for {}...'.format(host))
        graph, data_mem = graph_memory(data_frame, steps, hardware_info[host]["memory"])
        graph.get_figure().savefig(
            os.path.join(outdir, '{}_memory.png'.format(host)),
            bbox_inches='tight', pad_inches=0.25)
        pylab.close()

        if verbose:
            print('Generating storage I/O graph for {}...'.format(host))
        drives = set([
            series.split('_')[0]
            for series in data_frame.keys()
            if series.startswith(('sd', 'vd', 'hd', 'xvd'))
        ])
        graph, data_disk = graph_disk_io(data_frame, steps, drives)
        graph.get_figure().savefig(
            os.path.join(outdir, '{}_disk_io.png'.format(host)),
            bbox_inches='tight', pad_inches=0.25)
        pylab.close()

        print('Serializing output to pickle object for node {}...'.format(host))
        # "Clean" dataframes ready to be plotted
        collectl_info[host] = { "hardware": hardware_info,
                                "steps": steps, "cpu": data_cpu, "mem": data_mem,
                                "disk": data_disk, "net_bytes": data_net_bytes,
                                "net_pkts": data_net_pkts
                              }
    return collectl_info
241520
function plot(options) {
  /* Required Options */
  if (!options.data || !options.filename) {
    throw("The options object must have 'data' and 'filename' properties!");
    return;
  }
  /* Translate data into an object if needs be */
  if (_.isArray(options.data)) {
    /* If it's a one-dimentional array */
    if (_.isEqual(_.flatten(options.data), options.data)) {
      options.data = { 'Series 1': options.data };
    }
  }

  /* Defaults */
  if (!options.style) {
    options.style = 'lines'; /* Default to lines */
  }

  /* Apply moving averages and maximums */
  if (options.moving_avg) {
    options.data = apply_moving_filter(options.data, moving_average, options.moving_avg);
  }
  if (options.moving_max) {
    options.data = apply_moving_filter(options.data, moving_maximum, options.moving_max);
  }

  /* Execute Gnuplot specifing a function to be called when it terminates */
  if (options.format === 'pdf') { /* Special setup for pdf */
    gnuplot = exec('gnuplot | ps2pdf - ' + options.filename,
		   (options.exec ? options.exec : {}),
		   options.finish || post_gnuplot_processing);

  } else { /* Default for everything else */
    gnuplot = exec('gnuplot > ' + options.filename,
		   (options.exec ? options.exec : {}),
		   options.finish || post_gnuplot_processing);
  }

  /* Sets up gnuplot based on the properties we've been given in the
   * options object */
  setup_gnuplot(gnuplot, options);

  /* Get an array containing all the series */
  var series = _.keys(options.data);
  /* Reject series that are functions or come from higher up the protoype chain */
  var i;
  for (i = 0; i < series.length; i += 1) {
    if (!options.data.hasOwnProperty(series[i]) ||
	typeof options.data[series[i]] === 'function') {
      delete series[i]; /* undefine this element */
    }
  }
  /* Filter out any undefined elements */
  series = _.filter(series, function() { return true; });

  /* Print the command to actually do the plot */
  gnuplot.stdin.write('plot');
  for (i = 1; i <= series.length; i += 1) { /* For each series */
    /* Instruct gnuplot to plot this series */
    gnuplot.stdin.write('\'-\' using 1:2 title\'' + series[i - 1] +
			'\' with ' + options.style + ' lt 1 lc ' + i);
    /* If another series is to follow, add a comma */
    if (i < series.length) { gnuplot.stdin.write(','); }
  }
  gnuplot.stdin.write('\n');

  /* Print out the data */
  for (i = 0; i < series.length; i += 1) { /* For each series */
    for (key in options.data[series[i]]) {
      gnuplot.stdin.write(key + ' ' + options.data[series[i]][key] + '\n');
    }
    /* Terminate the data */
    gnuplot.stdin.write('e\n');
  }

  gnuplot.stdin.end();
}
437500
def _plot_properties(self, key, element):
        
        init = 'plot' not in self.handles
        size_multiplier = self.renderer.size/100.
        options = self._traverse_options(element, 'plot', ['width', 'height'], defaults=False)

        logger = self.param if init else None
        aspect_props, dimension_props = compute_layout_properties(
            self.width, self.height, self.frame_width, self.frame_height,
            options['width'], options['height'], self.aspect, self.data_aspect,
            self.responsive, size_multiplier, logger=logger)

        if not init:
            if aspect_props['aspect_ratio'] is None:
                aspect_props['aspect_ratio'] = self.state.aspect_ratio

        if self.dynamic and aspect_props['match_aspect']:
            # Sync the plot size on dynamic plots to support accurate
            # scaling of dimension ranges
            stream = PlotSize(subscribers=[self._update_size])
            self.callbacks.append(PlotSizeCallback(self, [stream], None))

        plot_props = {
            'margin':        self.margin,
            'max_width':     self.max_width,
            'max_height':    self.max_height,
            'min_width':     self.min_width,
            'min_height':    self.min_height
        }
        plot_props.update(aspect_props)
        if not self.drawn:
            plot_props.update(dimension_props)

        if self.bgcolor:
            plot_props['background_fill_color'] = self.bgcolor
        if self.border is not None:
            for p in ['left', 'right', 'top', 'bottom']:
                plot_props['min_border_'+p] = self.border
        lod = dict(self.param.defaults().get('lod', {}), **self.lod)
        for lod_prop, v in lod.items():
            plot_props['lod_'+lod_prop] = v
        return plot_props
801687
def summary_plot(data):
        """"""
        cats = OrderedDict()
        cats = {
            'inniepairs': {
                'name': 'Combined innie pairs',
                'color': '#191970'
            },
            'outiepairs': {
                'name': 'Combined outie pairs',
                'color': '#00A08A'
            },
            'uncombopairs': {
                'name': 'Uncombined pairs',
                'color': '#cd1076'
            },
            'discardpairs': {
                'name': 'Discarded pairs',
                'color': '#ffd700'
            }
        }
        splotconfig = {'id': 'flash_combo_stats_plot',
                       'title': 'FLASh: Read combination statistics',
                       'ylab': 'Number of read pairs',
                       'hide_zero_cats': False }
        return bargraph.plot(data, cats, splotconfig)
556934
def plot_temp_diagrams(config, results, temp_dir):
    """"""
    display_name = {
        'time': 'Compilation time (s)',
        'memory': 'Compiler memory usage (MB)',
    }

    files = config['files']
    img_files = []

    if any('slt' in result for result in results) and 'bmp' in files.values()[0]:
        config['modes']['slt'] = 'Using BOOST_METAPARSE_STRING with string literal templates'
        for f in files.values():
            f['slt'] = f['bmp'].replace('bmp', 'slt')

    for measured in ['time', 'memory']:
        mpts = sorted(int(k) for k in files.keys())
        img_files.append(os.path.join(temp_dir, '_{0}.png'.format(measured)))
        plot(
            {
                m: [(x, results[files[str(x)][m]][measured]) for x in mpts]
                for m in config['modes'].keys()
            },
            config['modes'],
            display_name[measured],
            (config['x_axis_label'], display_name[measured]),
            img_files[-1]
        )
    return img_files