Skip to content

Commit

Permalink
Added tight_layout() to plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan P. Dominguez-Morales committed Jul 23, 2020
1 parent db76daa commit 7961193
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pyNAVIS/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def spikegram(spikes_file, settings, dot_size = 0.2, dot_freq = 1, graph_tile =
if start_at_zero:
plt.xlim([0, np.max(spikes_file.timestamps)])

plt.tight_layout()
spk_fig.show()

@staticmethod
Expand Down Expand Up @@ -223,6 +224,7 @@ def histogram(spikes_file, settings, bar_line = 1, graph_tile = 'Histogram', ver
else:
plt.plot(np.arange(settings.num_channels * (settings.on_off_both + 1) * (settings.mono_stereo + 1)), spikes_count)

plt.tight_layout()
hst_fig.show()

@staticmethod
Expand Down Expand Up @@ -298,6 +300,8 @@ def average_activity(spikes_file, settings, graph_tile = 'Average activity', ver
if(settings.mono_stereo == 1):
plt.plot(np.arange(math.ceil(total_time/settings.bin_size)+1), average_activity_R, label='Right cochlea')
plt.legend(loc='best', ncol=2, frameon=True)

plt.tight_layout()
avg_fig.show()

@staticmethod
Expand Down

0 comments on commit 7961193

Please sign in to comment.