From 1c4e4ebb524455c06abb36cc455a6d85d0031b9c Mon Sep 17 00:00:00 2001 From: "Doorn, Nina (UT-TNW)" <n.doorn-1@utwente.nl> Date: Wed, 15 Jan 2025 11:32:38 +0100 Subject: [PATCH] corrected saving location error --- MakeFigures.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MakeFigures.py b/MakeFigures.py index f8d97a2..3d21824 100644 --- a/MakeFigures.py +++ b/MakeFigures.py @@ -2,21 +2,23 @@ import pickle import scipy.io as sio from brian2 import * -#specify where the images must be saved -outputdir = '/home/yourdir' +# specify where the images must be saved +outputdir = '../Figures/' + def rasterplot(APs, savetitle, dt, start, stop, color): figure(figsize=(8.5, 2.2), dpi=300) plt.plot(APs[:, 1] * dt, APs[:, 0], '|', markeredgecolor=color, ms=9, alpha=.3) - plt.hlines([-0.3, 0.7, 1.7, 2.7, 3.7, 4.7, 5.7, 6.7, 7.7, 8.7, 9.7, 10.7], -3, stop / second + 1300, colors='black', - linewidths=0.7) + plt.hlines([-0.3, 0.7, 1.7, 2.7, 3.7, 4.7, 5.7, 6.7, 7.7, 8.7, 9.7, 10.7], -3, stop / second + 1300, + colors='black', linewidths=0.7) xlim([start/second, stop/second]) axis("off") tight_layout() savefig(outputdir + savetitle + '.png', dpi=300, bbox_inches='tight') show() -def Marginaldiffplot(samples1, samples2, numparams, priorlimits, parlabels, savetitle): + +def marginaldiffplot(samples1, samples2, numparams, priorlimits, parlabels, savetitle): for ind in range(numparams): fig, ax = plt.subplots(1, 1, figsize=(1.7, 1.7), dpi=300) vals, xvals = np.histogram(samples1[:, ind], bins=30) @@ -28,6 +30,6 @@ def Marginaldiffplot(samples1, samples2, numparams, priorlimits, parlabels, save ax.set_xlabel(parlabels[ind]) ax.spines[['right', 'top']].set_visible(False) tight_layout() - plt.savefig(savetitle + parlabels[ind] + '.png', dpi=400, format='png', + plt.savefig(outputdir + savetitle + parlabels[ind] + '.png', dpi=400, format='png', bbox_inches="tight", transparent=True) plt.show() -- GitLab