SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
Functions | Variables
plot_membrane_pot Namespace Reference

Functions

def cm2inch (value)
 
def get_max (data)
 
def get_min (data)
 
def plot_membrane (ax, xs, ys, color, ymin=None, ymax=None, xmin=None, xmax=None, label="")
 

Variables

 parser = argparse.ArgumentParser(description='Plot membrane potential graphs')
 
 type
 
 float
 
 help
 
 str
 
 default
 
 int
 
 required
 
 True
 
 metavar
 
 args = parser.parse_args()
 
 fig = plt.figure(figsize=(cm2inch(12), cm2inch(6.0)))
 
 ax = fig.add_subplot(111)
 
 results = np.genfromtxt(args.file, delimiter=',', names=None)
 
 data = np.zeros((results.shape[0], len(results[0])))
 
 xs = np.array(data[:, args.tc])
 
 ys = np.array(data[:, args.y])
 
string label = "Membrane Voltage"
 
 color
 
 ymin
 
 ymax
 
 xmin
 
 xmax
 
 results2 = np.genfromtxt(args.sp, delimiter=',', names=None)
 
bool first = True
 
 x
 
 i
 
 linestyle
 
 lw
 
 spikes = np.zeros((results2.shape[0], len(results2[0])))
 
 loc
 
 bbox_to_anchor
 
 ncol
 
 format
 
 bbox_inches
 

Function Documentation

def plot_membrane_pot.cm2inch (   value)

Definition at line 58 of file plot_membrane_pot.py.

58 def cm2inch(value):
59  return value / 2.54
60 
61 
def plot_membrane_pot.get_max (   data)

Definition at line 62 of file plot_membrane_pot.py.

62 def get_max(data):
63  idcs = np.isfinite(data)
64  return np.max(data[np.isfinite(data)])
65 
66 
def plot_membrane_pot.get_min (   data)

Definition at line 67 of file plot_membrane_pot.py.

67 def get_min(data):
68  idcs = np.isfinite(data)
69  return np.min(data[np.isfinite(data)])
70 
71 
def plot_membrane_pot.plot_membrane (   ax,
  xs,
  ys,
  color,
  ymin = None,
  ymax = None,
  xmin = None,
  xmax = None,
  label = "" 
)
Plots membrane potential and spikes

ax -- plt.figure object to plot into
xs -- x values
ys -- y values
color -- color for the membrane potential graph
ymin -- Minimal y value for limits of the plot
ymax -- Maximal y value for limits of the plot
xmin -- Mnimial x value for limits of the plot
xmin -- Maximal x value for limits of the plot

Definition at line 72 of file plot_membrane_pot.py.

72 def plot_membrane(ax, xs, ys, color, ymin=None, ymax=None, xmin=None, xmax=None, label=""):
73  """
74  Plots membrane potential and spikes
75 
76  ax -- plt.figure object to plot into
77  xs -- x values
78  ys -- y values
79  color -- color for the membrane potential graph
80  ymin -- Minimal y value for limits of the plot
81  ymax -- Maximal y value for limits of the plot
82  xmin -- Mnimial x value for limits of the plot
83  xmin -- Maximal x value for limits of the plot
84  """
85 
86  ax.plot(xs, ys, color=color, lw=0.3, zorder=1, label=label)
87 
88  ax.set_xlabel("Time in ms")
89  ax.set_ylabel("Voltage in mV")
90 
91  # Set the limits of y-axxis
92  if (ymin is None) and (ymax is None):
93  ax.autoscale_view()
94  elif ymax is None:
95  ax.set_ylim(bottom=ymin)
96  elif ymin is None:
97  ax.set_ylim(top=ymax)
98  else:
99  ax.set_ylim(bottom=ymin, top=ymax)
100 
101  # Set the limits of x-axxis
102  if (xmin is None) and (xmax is None):
103  ax.set_xlim(left=get_min(xs), right=get_max(xs))
104  elif xmax is None:
105  ax.set_xlim(left=xmin, right=get_max(xs))
106  elif xmin is None:
107  ax.set_xlim(left=get_min(xs), right=xmax)
108  else:
109  ax.set_xlim(left=xmin, right=xmax)
110 
111 
def plot_membrane(ax, xs, ys, color, ymin=None, ymax=None, xmin=None, xmax=None, label="")

Variable Documentation

plot_membrane_pot.args = parser.parse_args()

Definition at line 46 of file plot_membrane_pot.py.

plot_membrane_pot.ax = fig.add_subplot(111)

Definition at line 113 of file plot_membrane_pot.py.

plot_membrane_pot.bbox_inches

Definition at line 167 of file plot_membrane_pot.py.

plot_membrane_pot.bbox_to_anchor

Definition at line 164 of file plot_membrane_pot.py.

plot_membrane_pot.color

Definition at line 128 of file plot_membrane_pot.py.

plot_membrane_pot.data = np.zeros((results.shape[0], len(results[0])))

Definition at line 117 of file plot_membrane_pot.py.

plot_membrane_pot.default

Definition at line 34 of file plot_membrane_pot.py.

plot_membrane_pot.fig = plt.figure(figsize=(cm2inch(12), cm2inch(6.0)))

Definition at line 112 of file plot_membrane_pot.py.

bool plot_membrane_pot.first = True

Definition at line 137 of file plot_membrane_pot.py.

plot_membrane_pot.float

Definition at line 30 of file plot_membrane_pot.py.

plot_membrane_pot.format

Definition at line 167 of file plot_membrane_pot.py.

plot_membrane_pot.help

Definition at line 30 of file plot_membrane_pot.py.

plot_membrane_pot.i

Definition at line 140 of file plot_membrane_pot.py.

plot_membrane_pot.int

Definition at line 35 of file plot_membrane_pot.py.

string plot_membrane_pot.label = "Membrane Voltage"

Definition at line 124 of file plot_membrane_pot.py.

plot_membrane_pot.linestyle

Definition at line 140 of file plot_membrane_pot.py.

plot_membrane_pot.loc

Definition at line 164 of file plot_membrane_pot.py.

plot_membrane_pot.lw

Definition at line 141 of file plot_membrane_pot.py.

plot_membrane_pot.metavar

Definition at line 43 of file plot_membrane_pot.py.

plot_membrane_pot.ncol

Definition at line 165 of file plot_membrane_pot.py.

plot_membrane_pot.parser = argparse.ArgumentParser(description='Plot membrane potential graphs')

Definition at line 27 of file plot_membrane_pot.py.

plot_membrane_pot.required

Definition at line 42 of file plot_membrane_pot.py.

plot_membrane_pot.results = np.genfromtxt(args.file, delimiter=',', names=None)

Definition at line 116 of file plot_membrane_pot.py.

plot_membrane_pot.results2 = np.genfromtxt(args.sp, delimiter=',', names=None)

Definition at line 134 of file plot_membrane_pot.py.

plot_membrane_pot.spikes = np.zeros((results2.shape[0], len(results2[0])))

Definition at line 148 of file plot_membrane_pot.py.

plot_membrane_pot.str

Definition at line 34 of file plot_membrane_pot.py.

plot_membrane_pot.True

Definition at line 42 of file plot_membrane_pot.py.

plot_membrane_pot.type

Definition at line 30 of file plot_membrane_pot.py.

plot_membrane_pot.x

Definition at line 140 of file plot_membrane_pot.py.

plot_membrane_pot.xmax

Definition at line 129 of file plot_membrane_pot.py.

plot_membrane_pot.xmin

Definition at line 129 of file plot_membrane_pot.py.

plot_membrane_pot.xs = np.array(data[:, args.tc])

Definition at line 121 of file plot_membrane_pot.py.

plot_membrane_pot.ymax

Definition at line 129 of file plot_membrane_pot.py.

plot_membrane_pot.ymin

Definition at line 128 of file plot_membrane_pot.py.

plot_membrane_pot.ys = np.array(data[:, args.y])

Definition at line 122 of file plot_membrane_pot.py.