.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_NeoEpoch_examples_plot_NeoEpoch_ex1.py: ===================== Neo Epoch - example 1 - Rasterplots ===================== This example shows how to use NeoEpoch .. code-block:: python from neoStructures import * import matplotlib.pyplot as plt from os.path import isdir, join, isfile import _pickle import seaborn as sns sns.set() sns.set_context('paper') Load neoEpoch data with _pickle .. code-block:: python data_dir = join('pySpikeAnalysis', 'sample_data') if isdir('pySpikeAnalysis') else join('..', '..', 'pySpikeAnalysis', 'sample_data') print(data_dir) neo_epoch_filename = r'neoepoch_070119_1117.p' if not isfile(join(data_dir, neo_epoch_filename)): raise ValueError('Cannot find the file {}'.format(join(data_dir, neo_epoch_filename))) with open(join(data_dir, neo_epoch_filename), 'rb') as f: try: neo_epoch = _pickle.load(f) except: raise Exception('Cannot pickle the file {}'.format(join(data_dir, neo_epoch_filename))) neo_epoch.save_fig = 0 .. rst-class:: sphx-glr-script-out Out: .. code-block:: none ../../pySpikeAnalysis/sample_data See information about NeoAll .. code-block:: python print(neo_epoch) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none NeoEpoch instance. 19 units and 27 epochs One Neo Segment per epoch, each segment has one Neo SpikeTrain for each unit, and one Neo AnalogSignal Plot the raster plot for unit 4 .. code-block:: python neo_epoch.plot_rasterplot(4) .. image:: /auto_examples/NeoEpoch_examples/images/sphx_glr_plot_NeoEpoch_ex1_001.png :class: sphx-glr-single-img **Total running time of the script:** ( 0 minutes 0.571 seconds) .. _sphx_glr_download_auto_examples_NeoEpoch_examples_plot_NeoEpoch_ex1.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_NeoEpoch_ex1.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_NeoEpoch_ex1.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_