Beispiel #1
0
def test_plot_with_legend():
    
    import matplottheme as mpt
    mpt.set_theme('ggplot2', 'ggplot2')    
    
    fig = plt.figure()
    ax = fig.add_subplot(111)
    
    np.random.seed(0)

    for i in range(8):
        y = np.random.normal(size=1000).cumsum()
        x = np.arange(1000)

        mpt.plot(ax, x, y, label='Data {index}'.format(index=str(i + 1)))
    mpt.legend(ax)
    
    mpt.set_theme('default', 'default')   
Beispiel #2
0
def animate(i):
    with open('ivana_mi_te_volimo.txt', 'r') as csvfile:
        plots = csv.reader(csvfile, delimiter=',')
        j = 0
        for row in plots:
            if len(row) > 1:
                temp = row[0].split(':')
                pom = int(temp[0]) * 3600 + int(temp[1]) * 60 + int(temp[2])
                x.append(pom)
                try:
                    y.append(float(row[1]))
                except:
                    y.append(26)
        ax1.clear()
        ax1.plot(x, y)
        f = open("ivana_mi_te_volimo.txt", "w").close()
        plt.xlabel('Time of The Day')
        plt.ylabel('Temperature')
        plt.title(
            'Graph representing corelation between temeperature and time')
        mpt.set_theme('ggplot2', 'ggplot2')
Beispiel #3
0
def test_ggplot2_style():
    fig = plt.figure(figsize=(12, 14))
    mpt.set_theme('ggplot2', 'ggplot2')
    content(fig)
    mpt.set_theme('default', 'default')