From 2757ca0d54b2006834f176238e74e0a1555044ca Mon Sep 17 00:00:00 2001 From: tillraab Date: Wed, 11 Sep 2019 11:14:09 +0200 Subject: [PATCH] changed plot to check electrodes --- electrode_check.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/electrode_check.py b/electrode_check.py index c14669e..eb29563 100644 --- a/electrode_check.py +++ b/electrode_check.py @@ -10,6 +10,7 @@ except: import subprocess import numpy as np import matplotlib.pyplot as plt +import matplotlib.gridspec as gridspec from time import sleep, time from os import system from sys import stdout @@ -276,8 +277,17 @@ def main(): disp_eth_power = True - fig, ax = plt.subplots(n_rows, n_cols, figsize=((n_cols * 2.5)/2.54, (n_rows * 2.5)/2.54), facecolor='white', - sharex=True, sharey=True) + + fig = plt.figure(figsize =(20/2.54, 12/2.54), facecolor='white') + axs = [] + gs = gridspec.GridSpec(n_rows, n_cols) + for y in range(n_rows): + for x in range(n_cols): + ax = plt.subplot(gs[y, x]) + axs.append(ax) + gs.update(left=0.05, bottom=0.05, top=1, right=1) + + ax = np.hstack(ax) channel_handle = [] init_fig = True @@ -329,8 +339,8 @@ def main(): min = np.min(np.hstack(channel_data)) if init_fig == True: for ch in channel_array: - h, = ax[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k') - ax[ch].set_ylim(min, max) + h, = axs[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k') + axs[ch].set_ylim(min, max) channel_handle.append(h) plt.show(block=False) init_fig = False