#!/usr/bin/python2
# -*- coding: utf-8 -*-

import matplotlib
matplotlib.rcParams['backend'] = 'Agg'
matplotlib.rc('font',  size='10')
matplotlib.rc('text', usetex=True)  # FIXME !! nicer but slower !!!

from  pygolem_lite import *
from pygolem_lite.modules import *

import sys
from numpy import *


def graphs(file_type):
    title = "Rake probe"
    print  "============================= plots ====="

    out = get_data('pozicedata', '' , "U [V]", xlabel="Position [mm]", tvec_rescale=1, line_format=".")

    multiplot(out, title , 'rakeprobe', (7,5), 100, 'vertical', file_type)

    #icon
    #out = get_data('NIbasic', "", "" , xlim = [0,None], xlabel = "",integrated=False, smoothing = 1e6 )
    #paralel_multiplot(out, "" , 'icon', (4,3), 40)

    os.system('convert -resize 150x120\! rakeprobe.png icon.png')




def main():
    if sys.argv[1] ==  "plots":
        graphs('png')
        saveconst('status', 0)


if __name__ == "__main__":
    main()