Beispiel #1
0
# Show the max/min value
xmin = 0
xmax = xvalues
ymin = 0
ymax = delta * len(data)

# The overall dimensions
xdim = 3.0
xscale = xdim / (2 * xvalues)

ydim = 1.5
yscale = ydim / ymax

# Get the header info
s = tkz.get_header()
s += tkz.get_begin_tikz(xdim=3.5, ydim=2.0, xunit='in', yunit='in')

# Create the plot background
for y in yticks:
    s += tkz.get_2d_plot([xmin, xmax], [y, y],
                         xscale=xscale,
                         yscale=yscale,
                         color='gray',
                         line_dim='thin',
                         xmin=xmin,
                         xmax=xmax,
                         ymin=ymin,
                         ymax=ymax)

for y in np.linspace(0, delta * (len(data) - 1), len(data)):
    s += tkz.get_2d_plot([xmin, xmax], [y, y],
Beispiel #2
0
    # Set legend parameters
    length = 0.15
    xlegend = 2.0
    
    # Set the positions of the tick locations
    yticks = [0, 0.25, 0.5, 0.75, 1.0]
    xticks = [ 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5 ]

    ylabel_offset = 0.15
    length = 0.15
    ylegend = 0.025 + len(heuristics)*0.06
    xlegend = 3.5

    # Get the header info
    s = tikz.get_header()
    s += tikz.get_begin_tikz(xdim=2, ydim=2, xunit='in', yunit='in')

    # Plot the axes
    s += tikz.get_2d_axes(xmin, xmax, ymin, ymax,
                          tick_frac=tick_frac, ylabel_offset=ylabel_offset,
                          xscale=xscale, yscale=yscale,
                          xticks=xticks, yticks=yticks,
                          xlabel='$\\alpha$', ylabel='Fraction of problems')

    for k in xrange(len(heuristics)):
        tau, rho = get_performance_profile(r[:, k], 1.5*xmax)
        s += tikz.get_2d_plot(tau, rho, xscale=xscale, yscale=yscale,
                              color=colors[k], line_dim='ultra thick',
                              xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
                              symbol=None)
Beispiel #3
0
else:
    ymax = 5 * int(np.ceil(ymax / 5.0))
    yticks = np.linspace(0, ymax, ymax + 1)
    ytick_labels = range(0, ymax + 1, 5)
    yticks = np.linspace(0, ymax, ymax / 5 + 1)

# The overall dimensions
xdim = 2.0
xscale = xdim / (xmax - xmin)

ydim = 1.75
yscale = ydim / (ymax - ymin)

# Get the header info
s = tkz.get_header()
s += tkz.get_begin_tikz(xdim=1.5, ydim=1.5, xunit='in', yunit='in')

s += tikzcolors

symbols = ['circle', 'square', 'triangle', 'delta', 'diamond']

for k, d in enumerate(data):
    xvals = np.log10(d[:, nnodes_index])
    if args.plot == 'effectivity':
        yvals = d[:, fval_eff_index]
    else:
        yvals = d[:, indc_eff_index]

    s += tkz.get_2d_plot(xvals,
                         yvals,
                         line_dim='very thick',
Beispiel #4
0
    for j in range(p + 1):
        if i != j:
            N *= (xi - knots[j]) / (knots[i] - knots[j])
    Nlist.append(N)

# Extract the colors for the lines. This creates a red-blue color scheme for an arbitrary number
# of curves.
colors = tikz.get_blue_red_colors(p + 1)

# Create the header for the plot. Note that all the data is written to a string
# that is then printed out to the file
s = tikz.get_header()

# Add the string to the beginning of the figure. This sets the overall dimensions, and the
# units used to specify the dimensions
s += tikz.get_begin_tikz(xdim=2.75, ydim=2.25, xunit='in', yunit='in')

# Specify any tick locations
yticks = [-0.25, 0, 0.5, 1.0]

# You can optionally specify tick labels
xticks = knots
xtick_labels = []
for k in knots:
    xtick_labels.append('%.2g' % (k))

# Set the scale factor applied to the plotting data. This can also be used to
# indirectly control the thickness of all the lines. Smaller scaling factors
# produce thicker lines
xscale = 0.75
yscale = 0.75