imganalyser.py
def plot_histogram(values, chart_title, series_labels):
    """Plots the supplied colour histogram as a barchart."""
    x_val = np.arange(0, 260, 260/len(values[0]))
    n_series = len(series_labels)
    colors = [[0.88, 0.75, 0.35, 0.7],
              [0.75, 0.63, 0.25, 0.7],
              [0.60, 0.47, 0.10, 0.7]]

    plt.subplots(1, n_series, figsize=(10, 3), dpi=120)
    plt.title(chart_title)

    if n_series > 1:
        assert n_series == len(values), "Supplied data series must have corresponding labels."
        width = 260/len(values[0])
        for i, series_label in enumerate(series_labels):
            plt.subplot(1, n_series, i+1)
            plt.bar(x_val, values[i][:], width, color=colors[i], label=series_label)
            plt.legend(loc='best')
            plt.xlim(0, 256)
    else:
        plt.bar(x_val, values, align='center', alpha=0.5)

    plt.show()
Plots the supplied colour histogram as a barchart.
Plots the supplied colour histogram as a barchart.
Plots the supplied colour histogram as a barchart .
def plot_histogram(values, chart_title, series_labels):
    x_val = np.arange(0, 260, 260/len(values[0]))
    n_series = len(series_labels)
    colors = [[0.88, 0.75, 0.35, 0.7],
              [0.75, 0.63, 0.25, 0.7],
              [0.60, 0.47, 0.10, 0.7]]
    plt.subplots(1, n_series, figsize=(10, 3), dpi=120)
    plt.title(chart_title)
    if n_series > 1:
        assert n_series == len(values), "Supplied data series must have corresponding labels."
        width = 260/len(values[0])
        for i, series_label in enumerate(series_labels):
            plt.subplot(1, n_series, i+1)
            plt.bar(x_val, values[i][:], width, color=colors[i], label=series_label)
            plt.legend(loc='best')
            plt.xlim(0, 256)
    else:
        plt.bar(x_val, values, align='center', alpha=0.5)
    plt.show()
def plot_histogram ( values , chart_title , series_labels ) : x_val = np . arange ( 0 , 260 , 260 / len ( values [ 0 ] ) ) n_series = len ( series_labels ) colors = [ [ 0.88 , 0.75 , 0.35 , 0.7 ] , [ 0.75 , 0.63 , 0.25 , 0.7 ] , [ 0.60 , 0.47 , 0.10 , 0.7 ] ] plt . subplots ( 1 , n_series , figsize = ( 10 , 3 ) , dpi = 120 ) plt . title ( chart_title ) if n_series > 1 : assert n_series == len ( values ) , "Supplied data series must have corresponding labels." width = 260 / len ( values [ 0 ] ) for i , series_label in enumerate ( series_labels ) : plt . subplot ( 1 , n_series , i + 1 ) plt . bar ( x_val , values [ i ] [ : ] , width , color = colors [ i ] , label = series_label ) plt . legend ( loc = 'best' ) plt . xlim ( 0 , 256 ) else : plt . bar ( x_val , values , align = 'center' , alpha = 0.5 ) plt . show ( )
Plots the supplied colour histogram as a barchart.
Plots the supplied colour histogram as a barchart .
"""Plots the supplied colour histogram as a barchart."""
values
chart_title
series_labels