# Path: pyrl/utils.py
# def println(line):
# def mkdir_p(path):
# def savelist(filename, list_):
# def loadlist(filename):
# def print_dict(settings_, indent=2, title=None):
# def copy_to_clipboard(s):
# def div(x, y):
# def divide(x, y):
# def get_here(file):
# def get_parent(dir):
# def save(filename, obj):
# def load(filename):
# def mm_to_inch(mm):
# def elapsed_time(tstart):
# 
# Path: pyrl/figtools.py
# THIS = "pyrl.figtools"
#     FNULL = open(os.devnull, 'w')
# def gradient(cmin, cmax):
# def apply_alpha(color, alpha=0.7):
#     def __getattr__(self, name):
#     def __init__(self, fig, p, rect):
#     def set_thickness(self, thickness):
#     def set_tick_params(self, ticksize, ticklabelsize, ticklabelpad):
#     def format(self, style, p=None):
#     def axis_off(self, axis='left'):
#     def plot(self, *args, **kwargs):
#     def xlabel(self, *args, **kwargs):
#     def ylabel(self, *args, **kwargs):
#     def xticks(self, *args, **kwargs):
#     def yticks(self, *args, **kwargs):
#     def xticklabels(self, *args, **kwargs):
#     def yticklabels(self, *args, **kwargs):
#     def equal(self):
#     def legend(self, *args, **kargs):
#     def text_upper_center(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_upper_left(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_upper_right(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_center(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_left(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_right(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def hline(self, y, **kwargs):
#     def vline(self, x, **kwargs):
#     def circle(self, center, r, **kwargs):
#     def highlight(self, x1, x2, **kwargs):
#     def lim(self, axis, data, lower=None, upper=None, margin=0.05, relative=True):
#     def sturges(data):
#     def scott(data, ddof=0):
#     def hist(self, data, bins=None, get_binedges=False, lw=0, **kwargs):
#     def __getattr__(self, name):
#     def __init__(self, fig, p, rect):
#     def xlabel(self, *args, **kwargs):
#     def ylabel(self, *args, **kwargs):
#     def zlabel(self, *args, **kwargs):
#     def xticks(self, *args, **kwargs):
#     def yticks(self, *args, **kwargs):
#     def zticks(self, *args, **kwargs):
#     def zcircle(self, center, r, z0, **kwargs):
#     def colors(name):
#     def __getattr__(self, name):
#     def __init__(self, **kwargs):
#     def add(self, name=None, rect=None, style='bottomleft', projection=None, **kwargs):
#     def __getitem__(self, k):
#     def plotlabels(self, labels, **kwargs):
#     def shared_lim(self, plots, axis, data, **kwargs):
#     def save(self, name=None, path=None, fmt=None, transparent=True, **kwargs):
#     def close(self):
# class Subplot(object):
# class Subplot3D(object):
# class Figure(object):


import imp
import os
import sys
import numpy as np
from pyrl          import utils
from pyrl.figtools import Figure, mpl



#=========================================================================================
# Files
#=========================================================================================

here   = utils.get_here(__file__)
parent = utils.get_parent(here)

# Paths
scratchpath  = os.path.join('/Users', 'francis', 'scratch', 'work', 'pyrl')
trialspath   = scratchpath
analysispath = os.path.join(parent, 'examples', 'analysis')
modelspath   = os.path.join(parent, 'examples', 'models')

# Analysis
analysisfile = os.path.join(analysispath, 'padoa_schioppa2006.py')
analysis     = imp.load_source('padoa_schioppa2006_analysis', analysisfile)

# Model
modelfile    = os.path.join(modelspath, 'padoa_schioppa2006.py')
model        = imp.load_source('model', modelfile)
trialsfile_b = os.path.join(trialspath, 'padoa_schioppa2006', 'trials_behavior.pkl')
trialsfile_e = os.path.join(trialspath, 'padoa_schioppa2006', 'trials_electrophysiology.pkl')

#=========================================================================================
# Figure
#=========================================================================================


# Path: pyrl/utils.py
# def println(line):
# def mkdir_p(path):
# def savelist(filename, list_):
# def loadlist(filename):
# def print_dict(settings_, indent=2, title=None):
# def copy_to_clipboard(s):
# def div(x, y):
# def divide(x, y):
# def get_here(file):
# def get_parent(dir):
# def save(filename, obj):
# def load(filename):
# def mm_to_inch(mm):
# def elapsed_time(tstart):
# 
# Path: pyrl/figtools.py
# THIS = "pyrl.figtools"
#     FNULL = open(os.devnull, 'w')
# def gradient(cmin, cmax):
# def apply_alpha(color, alpha=0.7):
#     def __getattr__(self, name):
#     def __init__(self, fig, p, rect):
#     def set_thickness(self, thickness):
#     def set_tick_params(self, ticksize, ticklabelsize, ticklabelpad):
#     def format(self, style, p=None):
#     def axis_off(self, axis='left'):
#     def plot(self, *args, **kwargs):
#     def xlabel(self, *args, **kwargs):
#     def ylabel(self, *args, **kwargs):
#     def xticks(self, *args, **kwargs):
#     def yticks(self, *args, **kwargs):
#     def xticklabels(self, *args, **kwargs):
#     def yticklabels(self, *args, **kwargs):
#     def equal(self):
#     def legend(self, *args, **kargs):
#     def text_upper_center(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_upper_left(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_upper_right(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_center(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_left(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def text_lower_right(self, s, dx=0, dy=0, fontsize=7.5, color='k', **kwargs):
#     def hline(self, y, **kwargs):
#     def vline(self, x, **kwargs):
#     def circle(self, center, r, **kwargs):
#     def highlight(self, x1, x2, **kwargs):
#     def lim(self, axis, data, lower=None, upper=None, margin=0.05, relative=True):
#     def sturges(data):
#     def scott(data, ddof=0):
#     def hist(self, data, bins=None, get_binedges=False, lw=0, **kwargs):
#     def __getattr__(self, name):
#     def __init__(self, fig, p, rect):
#     def xlabel(self, *args, **kwargs):
#     def ylabel(self, *args, **kwargs):
#     def zlabel(self, *args, **kwargs):
#     def xticks(self, *args, **kwargs):
#     def yticks(self, *args, **kwargs):
#     def zticks(self, *args, **kwargs):
#     def zcircle(self, center, r, z0, **kwargs):
#     def colors(name):
#     def __getattr__(self, name):
#     def __init__(self, **kwargs):
#     def add(self, name=None, rect=None, style='bottomleft', projection=None, **kwargs):
#     def __getitem__(self, k):
#     def plotlabels(self, labels, **kwargs):
#     def shared_lim(self, plots, axis, data, **kwargs):
#     def save(self, name=None, path=None, fmt=None, transparent=True, **kwargs):
#     def close(self):
# class Subplot(object):
# class Subplot3D(object):
# class Figure(object):


# Path: paper/fig_onr.py
import imp
import os
import sys
import numpy as np
from pyrl          import utils
from pyrl.figtools import Figure, mpl




#=========================================================================================
# Files
#=========================================================================================

here   = utils.get_here(__file__)
parent = utils.get_parent(here)

# Paths
scratchpath  = os.path.join('/Users', 'francis', 'scratch', 'work', 'pyrl')
trialspath   = scratchpath
analysispath = os.path.join(parent, 'examples', 'analysis')
modelspath   = os.path.join(parent, 'examples', 'models')

# Analysis
analysisfile = os.path.join(analysispath, 'padoa_schioppa2006.py')
analysis     = imp.load_source('padoa_schioppa2006_analysis', analysisfile)

# Model
modelfile    = os.path.join(modelspath, 'padoa_schioppa2006.py')
model        = imp.load_source('model', modelfile)
trialsfile_b = os.path.join(trialspath, 'padoa_schioppa2006', 'trials_behavior.pkl')
trialsfile_e = os.path.join(trialspath, 'padoa_schioppa2006', 'trials_electrophysiology.pkl')

#=========================================================================================
# Figure
#=========================================================================================


w = utils.mm_to_inch(174)