P-unit_model/test.py
2020-09-08 18:27:09 +02:00

50 lines
1.7 KiB
Python

from Baseline import get_baseline_class
from CellData import CellData, icelldata_of_dir
from models.LIFACnoise import LifacNoiseModel
from Baseline import BaselineCellData, BaselineModel
from os import listdir
import numpy as np
from IPython import embed
import pyrelacs.DataLoader as Dl
from ModelFit import ModelFit, get_best_fit
from FiCurve import FICurveModel, FICurveCellData
import os
import matplotlib.pyplot as plt
import functions as fu
from scipy.optimize import curve_fit
from scipy.signal import find_peaks
from thunderfish.eventdetection import threshold_crossing_times, threshold_crossings, detect_peaks
import helperFunctions as hF
import models.smallModels as sM
from stimuli.SinusoidalStepStimulus import SinusoidalStepStimulus
from matplotlib import gridspec
from plottools.axes import labelaxes_params
def demo():
""" Run a demonstration of the axes module.
"""
def afigure():
fig = plt.figure()
gs = gridspec.GridSpec(2, 3, width_ratios=[5, 1.5, 2.4])
gs.update(left=0.075, bottom=0.14, right=0.985, top=0.9, wspace=0.6, hspace=0.6)
ax1 = fig.add_subplot(gs[:, 0])
ax2 = fig.add_subplot(gs[0, 1:])
ax3 = fig.add_subplot(gs[1, 1])
ax4 = fig.add_subplot(gs[1, 2])
for ax in [ax1, ax2, ax3, ax4]:
ax.set_xlabel('xlabel')
ax.set_ylabel('ylabel')
return fig, (ax1, ax2, ax3, ax4)
labelaxes_params(xoffs='auto', yoffs=-1, labels='A', font=dict(fontweight='bold'))
fig, axs = afigure()
# axs[0].text(0.5, 0.5, 'fig.label_axes()', transform=axs[0].transAxes, ha='center')
# axs[0].text(0.0, 0.0, 'X', transform=fig.transFigure, ha='left', va='bottom')
fig.label_axes()
plt.show()
demo()