def set_tick(args, font, x1beg, x1end, n1beg, n1end, d1, axis1len, x2beg, x2end, n2beg, n2end, d2, axis2len, extend=False):
    ax = plt.gca()
    label_1_size = float(args.label1size)
    label_2_size = float(args.label2size)
    xlabel = ax.set_xlabel(args.label2, fontsize=label_2_size, labelpad=((float(args.label2pad) * 72) * 2))
    ylabel = ax.set_ylabel(args.label1, fontsize=label_1_size, labelpad=((float(args.label1pad) * 72) * 2))
    l = ax.yaxis.get_label()
    l.set_fontproperties(font)
    l.set_fontsize(label_1_size)
    l = ax.xaxis.get_label()
    l.set_fontproperties(font)
    l.set_fontsize(label_2_size)
    if (args.label2loc is not None):
        ax.xaxis.set_label_position(args.label2loc)
    elif args.ticktop:
        ax.xaxis.set_label_position('top')
    else:
        ax.xaxis.set_label_position('bottom')
    if (args.label1loc is not None):
        ax.yaxis.set_label_position(args.label1loc)
    elif args.tickleft:
        ax.yaxis.set_label_position('left')
    else:
        ax.yaxis.set_label_position('right')
        ylabel.set_rotation(270)
    ax.get_yaxis().set_tick_params(which='both', direction='out')
    ax.get_xaxis().set_tick_params(which='both', direction='out')
    plt.tick_params(axis='x', which='both', bottom=args.tickbottom, top=args.ticktop, labelbottom=args.tickbottom, labeltop=args.ticktop)
    plt.tick_params(axis='y', which='both', left=args.tickleft, right=args.tickright, labelleft=args.tickleft, labelright=args.tickright)
    if (args.tick1size is None):
        tick_1_font_size = (label_1_size - 2)
    else:
        tick_1_font_size = float(args.tick1size)
    if (args.tick2size is None):
        tick_2_font_size = (label_2_size - 2)
    else:
        tick_2_font_size = float(args.tick2size)
    (tick_1_location, tick_1_label, tick_1_minor) = define_tick(args.ticks1, args.tick1beg, args.tick1end, args.tick1d, args.mtick1, x1beg, x1end, ((n1end - n1beg) + 1), d1, axis1len, args.tick1format, extend)
    plt.yticks(tick_1_location, tick_1_label, fontsize=tick_1_font_size, rotation=float(args.tick1rot))
    if (not args.tick1label):
        ax.yaxis.set_ticklabels([])
    (tick_2_location, tick_2_label, tick_2_minor) = define_tick(args.ticks2, args.tick2beg, args.tick2end, args.tick2d, args.mtick2, x2beg, x2end, ((n2end - n2beg) + 1), d2, axis2len, args.tick2format, extend)
    plt.xticks(tick_2_location, tick_2_label, fontsize=tick_2_font_size, rotation=float(args.tick2rot))
    if (not args.tick2label):
        ax.xaxis.set_ticklabels([])
    ax.tick_params('both', length=float(args.tickmajorlen), width=float(args.tickmajorwid), which='major')
    ax.set_yticks(tick_1_minor, minor=True)
    ax.set_xticks(tick_2_minor, minor=True)
    if (args.tickminorlen is None):
        tick_minor_length = (0.5 * float(args.tickmajorlen))
    else:
        tick_minor_length = float(args.tickminorlen)
    if (args.tickminorwid is None):
        tick_minor_width = (0.75 * float(args.tickmajorwid))
    else:
        tick_minor_width = float(args.tickminorwid)
    ax.tick_params('both', length=tick_minor_length, width=tick_minor_width, which='minor')
    for l in ax.yaxis.get_ticklabels():
        l.set_fontproperties(font)
        l.set_fontsize(tick_1_font_size)
    for l in ax.xaxis.get_ticklabels():
        l.set_fontproperties(font)
        l.set_fontsize(tick_2_font_size)
def set_tick(args, font, x1beg, x1end, n1beg, n1end, d1, axis1len, x2beg, x2end, n2beg, n2end, d2, axis2len, extend=False):
    ax = plt.gca()
    label_1_size = float(args.label1size)
    label_2_size = float(args.label2size)
    xlabel = ax.set_xlabel(args.label2, fontsize=label_2_size, labelpad=((float(args.label2pad) * 72) * 2))
    ylabel = ax.set_ylabel(args.label1, fontsize=label_1_size, labelpad=((float(args.label1pad) * 72) * 2))
    l = ax.yaxis.get_label()
    l.set_fontproperties(font)
    l.set_fontsize(label_1_size)
    l = ax.xaxis.get_label()
    l.set_fontproperties(font)
    l.set_fontsize(label_2_size)
    if (args.label2loc is not None):
        ax.xaxis.set_label_position(args.label2loc)
    elif args.ticktop:
        ax.xaxis.set_label_position('top')
    else:
        ax.xaxis.set_label_position('bottom')
    if (args.label1loc is not None):
        ax.yaxis.set_label_position(args.label1loc)
    elif args.tickleft:
        ax.yaxis.set_label_position('left')
    else:
        ax.yaxis.set_label_position('right')
        ylabel.set_rotation(270)
    ax.get_yaxis().set_tick_params(which='both', direction='out')
    ax.get_xaxis().set_tick_params(which='both', direction='out')
    plt.tick_params(axis='x', which='both', bottom=args.tickbottom, top=args.ticktop, labelbottom=args.tickbottom, labeltop=args.ticktop)
    plt.tick_params(axis='y', which='both', left=args.tickleft, right=args.tickright, labelleft=args.tickleft, labelright=args.tickright)
    if (args.tick1size is None):
        tick_1_font_size = (label_1_size - 2)
    else:
        tick_1_font_size = float(args.tick1size)
    if (args.tick2size is None):
        tick_2_font_size = (label_2_size - 2)
    else:
        tick_2_font_size = float(args.tick2size)
    (tick_1_location, tick_1_label, tick_1_minor) = define_tick(args.ticks1, args.tick1beg, args.tick1end, args.tick1d, args.mtick1, x1beg, x1end, ((n1end - n1beg) + 1), d1, axis1len, args.tick1format, extend)
    plt.yticks(tick_1_location, tick_1_label, fontsize=tick_1_font_size, rotation=float(args.tick1rot))
    if (not args.tick1label):
        ax.yaxis.set_ticklabels([])
    (tick_2_location, tick_2_label, tick_2_minor) = define_tick(args.ticks2, args.tick2beg, args.tick2end, args.tick2d, args.mtick2, x2beg, x2end, ((n2end - n2beg) + 1), d2, axis2len, args.tick2format, extend)
    plt.xticks(tick_2_location, tick_2_label, fontsize=tick_2_font_size, rotation=float(args.tick2rot))
    if (not args.tick2label):
        ax.xaxis.set_ticklabels([])
    ax.tick_params('both', length=float(args.tickmajorlen), width=float(args.tickmajorwid), which='major')
    ax.set_yticks(tick_1_minor, minor=True)
    ax.set_xticks(tick_2_minor, minor=True)
    if (args.tickminorlen is None):
        tick_minor_length = (0.5 * float(args.tickmajorlen))
    else:
        tick_minor_length = float(args.tickminorlen)
    if (args.tickminorwid is None):
        tick_minor_width = (0.75 * float(args.tickmajorwid))
    else:
        tick_minor_width = float(args.tickminorwid)
    ax.tick_params('both', length=tick_minor_length, width=tick_minor_width, which='minor')
    for l in ax.yaxis.get_ticklabels():
        l.set_fontproperties(font)
        l.set_fontsize(tick_1_font_size)
    for l in ax.xaxis.get_ticklabels():
        l.set_fontproperties(font)
        l.set_fontsize(tick_2_font_size)