Skip to content

Commit

Permalink
reduce the number of plot per page
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkilic committed Feb 2, 2024
1 parent e14850e commit 03aab42
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bluepyefe/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def plot_recordings(self, protocol_name, output_dir=None, show=False):
recordings_sorted = [recordings[k] for k in numpy.argsort(recordings_amp)]

n_cols = 6
max_plots_per_page = 48
max_plots_per_page = 24
total_pages = int(numpy.ceil(len(recordings_sorted) / max_plots_per_page))

for page in range(total_pages):
Expand All @@ -253,7 +253,7 @@ def plot_recordings(self, protocol_name, output_dir=None, show=False):
display_ylabel = col == 0
display_xlabel = (row // 2) + 1 == n_rows // 2

_, _ = rec.plot(
rec.plot(
axis_current=axs[row][col],
axis_voltage=axs[row + 1][col],
display_xlabel=display_xlabel,
Expand All @@ -275,11 +275,7 @@ def plot_recordings(self, protocol_name, output_dir=None, show=False):
if output_dir is not None:
filename = f"{self.name}_{protocol_name}_recordings_page_{page + 1}.pdf"
dirname = pathlib.Path(output_dir) / self.name
filepath = dirname / filename
dirname.mkdir(parents=True, exist_ok=True)
fig.savefig(filepath, bbox_inches='tight')

plt.close(fig)
_save_fig(dirname, filename)


def plot_all_recordings(self, output_dir=None, show=False):
Expand Down

0 comments on commit 03aab42

Please sign in to comment.