System01 DataSet Plots

Plots from training and validation datasets used in the IT2FIS System01

# -*- coding: utf-8 -*- """ System01 Patterns Plots: Plots Training and Validation Patterns used in System01 Created on Sun Apr 13 19:21:39 2014 @author: Vítor Emmanuel Andrade @email: vitor.e.a@gmail.com """

In [8]:
# Import used modules
import scipy as sp
import numpy as np
import pandas as pd
import pylab as pl

In [14]:
# Load the data from a pandas file converted from the MAT-file
dados = np.load('../../Datasets/FDIAC/Dados_Sist01_train.pdy')

In [62]:
# Check if it works in other contexts
def pretty_plot(xlbl = None, ylbl = None, titulo = None):
    '''Make beatiful plots.
    
    Args: xlabel
          ylabel
          title
    '''
    fig = {}
    ax = {}
    
    fig[padrao] = figure(num=None, figsize=(15,8), dpi=500, facecolor='w', edgecolor='k', frameon=True)
    ax[padrao] = axes()
    fig[padrao].patch.set_alpha(0) # Sets the figure transparent
    ax[padrao].patch.set_alpha(0) # Sets the axis transparent
    ax[padrao].spines['left'].set_color('gray')
    ax[padrao].spines['right'].set_color('gray')
    ax[padrao].spines['top'].set_color('gray')
    ax[padrao].spines['bottom'].set_color('gray')
    ax[padrao].spines['left'].set_linewidth(2)
    ax[padrao].spines['right'].set_linewidth(2)
    ax[padrao].spines['top'].set_linewidth(2)
    ax[padrao].spines['bottom'].set_linewidth(2)
    ax[padrao].yaxis.tick_left()
    ax[padrao].xaxis.tick_bottom()
    ax[padrao].tick_params(direction='inout', length=8, width=1.5, colors='gray', labelsize=14, pad=7)
    ax[padrao].grid(color='gray', alpha=0.8, linestyle='dashed', linewidth=0.5)
    
    if xlbl: # Check if labels and title exists, use if true.
        xlabel(xlbl, fontsize=18)
    if ylbl:
        ylabel(ylbl, fontsize=18)
    if titulo:
        title(titulo)

In [152]:
# Plot the patterns
for padrao in dados.keys():
    if not dados[padrao].empty: # Plot just not empty Patterns
        pretty_plot(r'$time (h)$', r'$temperature (^{\circ}C)$') # Make better plots
        # Latex labels - Use 'r' in front of to escape latex
        pl.plot(dados[padrao].index, dados[padrao].Temperature, ls='-', c='darkgray', lw=1.5, marker='o', markersize=3, mec='b', mfc='b')
        # Save plots in high resolution figures
        pl.savefig('images/'+padrao+'_train.eps', type='eps', dpi=500)
        pl.savefig('images/'+padrao+'_train.png', format='png', dpi=500)



In [ ]: