From fde58b319d9fece5b19244abbc7003add12214b2 Mon Sep 17 00:00:00 2001 From: "a.ott" Date: Tue, 8 Sep 2020 18:27:09 +0200 Subject: [PATCH] test plottools --- test.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test.py b/test.py index a245ae5..d2a452f 100644 --- a/test.py +++ b/test.py @@ -15,8 +15,36 @@ 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() \ No newline at end of file