def test_plot_raster(spike_trains, node_groups, with_histogram): fig = plotting.plot_raster(spike_trains=spike_trains, node_groups=node_groups, with_histogram=with_histogram, show=False) assert (isinstance(fig, matplotlib.figure.Figure)) assert (len(fig.axes) == 2 if with_histogram else 1)
def test_load_spikes_api(spike_trains): fig = plotting.plot_raster(spike_trains=spike_trains, show=False) assert (isinstance(fig, matplotlib.figure.Figure))
def test_load_spikes_file(spike_trains): tmpfile = tempfile.NamedTemporaryFile(suffix='.h5') spike_trains.to_sonata(tmpfile.name) fig = plotting.plot_raster(spike_trains=tmpfile.name, show=False) assert (isinstance(fig, matplotlib.figure.Figure))
def plot_raster(config_file, spikes_file=None): spike_trains = load_spikes_file(config_file=config_file, spikes_file=spikes_file) plotting.plot_raster(spike_trains) plt.show()