GithubHelp home page GithubHelp logo

jpgill86 / neoplots Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 37 KB

A simple Python module for quickly plotting Neo objects (neo.readthedocs.io) in either Matplotlib or Plotly

License: MIT License

Python 100.00%

neoplots's Introduction

NeoPlots

import NeoPlots
import neo
from neo.test.generate_datasets import generate_one_simple_segment

import matplotlib.colors as mcolors
colors = list(mcolors.TABLEAU_COLORS.values())[1:]

# generate some random data and add annotations
seg = generate_one_simple_segment(supported_objects=neo.objectlist)
for i, sig in enumerate(seg.analogsignals):
    sig.name = f'sig {i}'
for i, st in enumerate(seg.spiketrains):
    st.annotate(channels=[f'sig {i % len(seg.analogsignals)}'])
    st.annotate(color=colors[i % len(colors)])
for i, ep in enumerate(seg.epochs):
    ep.durations *= 0.1  # reduce durs so epochs are easier to see in this random example
    ep.annotate(color=colors[i % len(colors)])

# generate, save, and display the plot
engine = 'matplotlib'  # or 'plotly'
fig = NeoPlots.plot_segment(engine=engine, segment=seg,
                            ylims={sig.name: (-0.5, 1.5) for sig in seg.analogsignals})
NeoPlots.save_fig(fig, 'myfig')
fig.show()

neoplots's People

Contributors

jpgill86 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.