plot.py 296 Bytes
Newer Older
Dos Santos David's avatar
Dos Santos David committed
1 2 3 4 5 6 7 8 9 10 11 12
import matplotlib
matplotlib.use('Agg')

import matplotlib.pyplot as plt

def plot_bar(x, heights, linewidth=2, filename='image.png', xlabel=None, ylabel=None):
    plt.plot(x, heights, linewidth=linewidth)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)

    plt.savefig(filename)
    plt.close()