Beispiel #1
0
                     yscale=yscale,
                     xticks=xticks,
                     yticks=yticks,
                     xtick_labels=xtick_labels,
                     ytick_labels=ytick_labels,
                     tick_font='small',
                     tick_frac=0.0125,
                     xlabel_offset=0.1,
                     xlabel='$\\log_{10}(\\text{Error})$',
                     ylabel_offset=0.065,
                     ylabel='Percentage')

for k, d in enumerate(data):
    bars = []
    ymin = delta * (len(data) - k - 1)
    for i in range(d.shape[0]):
        bars.append([d[i, 3] + ymin])

    s += tkz.get_bar_chart(bars,
                           color_list=[colors[k % len(colors)]],
                           xscale=xscale,
                           yscale=yscale,
                           ymin=ymin,
                           ymax=ymax)

s += tkz.get_end_tikz()

fp = open('cylinder_plot.tex', 'w')
fp.write(s)
fp.close()
Beispiel #2
0
                              xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
                              symbol=None)

    # Add a label to the legend
    xlegend_len = 1.5
    ylegend_len = 0.06*(len(heuristics)-1)
    s += '\\draw[fill=white] (%f,%f) rectangle (%f,%f);'%(
        (xlegend - 0.15)*xscale, (ylegend + 0.04)*yscale,
        (xlegend + xlegend_len)*xscale, (ylegend - ylegend_len - 0.04)*yscale)
    for k in xrange(len(heuristics)):
        s += tikz.get_legend_entry(xlegend, ylegend - 0.06*k, length,
                                   xscale=xscale, yscale=yscale,
                                   color=colors[k], line_dim='ultra thick',
                                   symbol=None, font_size='footnotesize',
                                   label=heur_labels[k])
    s += tikz.get_end_tikz()

    # Create the tikz/LaTeX file
    filename = 'performance_profile_%s_%s.pdf'%(output_type, variables[imerit])
    output = os.path.join(output_dir, filename)
    fp = open(output, 'w')
    fp.write(s)
    fp.close()

    # pdflatex the resulting file
    os.system('cd %s; pdflatex %s > /dev/null; cd ..'%(output_dir, 
                                                       filename))

    # Plot the mass infeasibility 
    xscale = 0.3