# Path: aqmt/plot/common.py
# def plot_header():
#     return """
#         set key spacing 1.1
#         set grid xtics ytics ztics lw 1 lc rgb 'black'
# 
#         # from https://github.com/aschn/gnuplot-colorbrewer
#         # line styles for ColorBrewer Dark2
#         # for use with qualitative/categorical data
#         # provides 8 dark colors based on Set2
#         # compatible with gnuplot >=4.2
#         # author: Anna Schneider
# 
#         # line styles
#         set style line 1 lc rgb '#1B9E77' # dark teal
#         set style line 2 lc rgb '#D95F02' # dark orange
#         set style line 3 lc rgb '#7570B3' # dark lilac
#         set style line 4 lc rgb '#E7298A' # dark magenta
#         set style line 5 lc rgb '#66A61E' # dark lime green
#         set style line 6 lc rgb '#E6AB02' # dark banana
#         set style line 7 lc rgb '#A6761D' # dark tan
#         set style line 8 lc rgb '#666666' # dark gray
# 
#         # palette
#         set palette maxcolors 8
#         set palette defined ( 0 '#1B9E77',\\
#                               1 '#D95F02',\\
#                               2 '#7570B3',\\
#                               3 '#E7298A',\\
#                               4 '#66A61E',\\
#                               5 '#E6AB02',\\
#                               6 '#A6761D',\\
#                               7 '#666666' )
# 
#         """


from .common import plot_header

    return n


def build_plot(testfolder, components, x_scale=1, y_scale=1, title='DEFAULT',
        skip_sample_line=False):
    """
    Generate a plot for a single test case
    """

    class Plotdef:
        pass

    plotdef = Plotdef()
    plotdef.x_scale = x_scale
    plotdef.y_scale = y_scale

    aggregated_samples_to_skip = get_aggregated_samples_to_skip(testfolder)
    n_samples = get_number_samples(testfolder)

    def plot_container(result):
        plot_title = ''
        if title == 'DEFAULT':
            plot_title = "title '" + testfolder + "'"
        elif title is not None:
            plot_title = "title '" + title + "'"

        result['gpi'] = plot_header() + """
            set multiplot layout """ + str(len(components)) + """,1 columnsfirst """ + plot_title + """
            set offset graph 0.02, graph 0.02, graph 0.02, graph 0.02

# Path: aqmt/plot/common.py
# def plot_header():
#     return """
#         set key spacing 1.1
#         set grid xtics ytics ztics lw 1 lc rgb 'black'
# 
#         # from https://github.com/aschn/gnuplot-colorbrewer
#         # line styles for ColorBrewer Dark2
#         # for use with qualitative/categorical data
#         # provides 8 dark colors based on Set2
#         # compatible with gnuplot >=4.2
#         # author: Anna Schneider
# 
#         # line styles
#         set style line 1 lc rgb '#1B9E77' # dark teal
#         set style line 2 lc rgb '#D95F02' # dark orange
#         set style line 3 lc rgb '#7570B3' # dark lilac
#         set style line 4 lc rgb '#E7298A' # dark magenta
#         set style line 5 lc rgb '#66A61E' # dark lime green
#         set style line 6 lc rgb '#E6AB02' # dark banana
#         set style line 7 lc rgb '#A6761D' # dark tan
#         set style line 8 lc rgb '#666666' # dark gray
# 
#         # palette
#         set palette maxcolors 8
#         set palette defined ( 0 '#1B9E77',\\
#                               1 '#D95F02',\\
#                               2 '#7570B3',\\
#                               3 '#E7298A',\\
#                               4 '#66A61E',\\
#                               5 '#E6AB02',\\
#                               6 '#A6761D',\\
#                               7 '#666666' )
# 
#         """


# Path: aqmt/plot/flow.py
from .common import plot_header


    return n


def build_plot(testfolder, components, x_scale=1, y_scale=1, title='DEFAULT',
        skip_sample_line=False):
    """
    Generate a plot for a single test case
    """

    class Plotdef:
        pass

    plotdef = Plotdef()
    plotdef.x_scale = x_scale
    plotdef.y_scale = y_scale

    aggregated_samples_to_skip = get_aggregated_samples_to_skip(testfolder)
    n_samples = get_number_samples(testfolder)

    def plot_container(result):
        plot_title = ''
        if title == 'DEFAULT':
            plot_title = "title '" + testfolder + "'"
        elif title is not None:
            plot_title = "title '" + title + "'"

        result['gpi'] = plot_header() + """
            set multiplot layout """ + str(len(components)) + """,1 columnsfirst """ + plot_title + """
            set offset graph 0.02, graph 0.02, graph 0.02, graph 0.02

            set lmargin 14