test plottools

This commit is contained in:
a.ott 2020-09-08 18:27:09 +02:00
parent 69de5ecf59
commit fde58b319d

28
test.py
View File

@ -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()