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

Functions

def cm2inch (value)
 
def plot_measure (ax, xs, ys, ys_std, color, simulator, xlabel, ylabel, ys_ref=None, first=True, ymin=None, ymax=None)
 
def normalize (data, norm)
 
def get_max (data)
 
def get_min (data)
 

Variables

 parser = argparse.ArgumentParser(description='Plot one-dimensional graphs')
 
 help
 
 action
 
 type
 
 float
 
 int
 
 default
 
 str
 
 required
 
 True
 
 metavar
 
 nargs
 
 args = parser.parse_args()
 
 fig = plt.figure(figsize=(cm2inch(12), cm2inch(6.0)))
 
 ax = fig.add_subplot(111)
 
 results = np.genfromtxt(target_file, delimiter=',', names=True)
 
 keys = results.dtype.names
 
 data = np.zeros((results.shape[0], len(keys)))
 
 xs = np.array(data[:, args.x])
 
 ys = np.array(data[:, args.y])
 
 ys_dev = None
 
 xlabel = DIM_LABELS[keys[args.x]]
 
 ylabel = DIM_LABELS[keys[args.y]]
 
 max = get_max(np.abs(ys))
 
 simulator = target_file.split('_')[-1].split('.csv')[0].split('.')[-1]
 
 color
 
 ymin
 
 ymax
 
 loc
 
 bbox_to_anchor
 
 ncol
 
 format
 
 bbox_inches
 
 o
 

Function Documentation

def 1dim_plot.cm2inch (   value)

Definition at line 57 of file 1dim_plot.py.

57 def cm2inch(value):
58  return value / 2.54
59 
60 
def cm2inch(value)
Definition: 1dim_plot.py:57
def 1dim_plot.get_max (   data)

Definition at line 89 of file 1dim_plot.py.

89 def get_max(data):
90  idcs = np.isfinite(data)
91  return np.max(data[np.isfinite(data)])
92 
93 
def get_max(data)
Definition: 1dim_plot.py:89
def 1dim_plot.get_min (   data)

Definition at line 94 of file 1dim_plot.py.

94 def get_min(data):
95  idcs = np.isfinite(data)
96  return np.min(data[np.isfinite(data)])
97 
def get_min(data)
Definition: 1dim_plot.py:94
def 1dim_plot.normalize (   data,
  norm 
)

Definition at line 84 of file 1dim_plot.py.

84 def normalize(data, norm):
85  for i in range(0, len(data)):
86  data[i] = old_div(data[i], norm)
87 
88 
def normalize(data, norm)
Definition: 1dim_plot.py:84
def 1dim_plot.plot_measure (   ax,
  xs,
  ys,
  ys_std,
  color,
  simulator,
  xlabel,
  ylabel,
  ys_ref = None,
  first = True,
  ymin = None,
  ymax = None 
)

Definition at line 62 of file 1dim_plot.py.

62  ys_ref=None, first=True, ymin=None, ymax=None):
63 
64  ax.plot(xs, ys, color=color, lw=1.0, zorder=1, label=simulator)
65 
66  if ys_std is not None:
67  ax.plot(xs, ys - ys_std, lw=0.5,
68  linestyle=':', color=color, zorder=0)
69  ax.plot(xs, ys + ys_std, lw=0.5,
70  linestyle=':', color=color, zorder=0)
71 
72  ax.set_xlabel(xlabel)
73  ax.set_ylabel(ylabel)
74  if (ymin is None) and (ymax is None):
75  ax.autoscale_view()
76  elif ymax is None:
77  ax.set_ylim(bottom=ymin)
78  elif ymin is None:
79  ax.set_ylim(top=ymax)
80  else:
81  ax.set_ylim(bottom=ymin, top=ymax)
82 
83 

Variable Documentation

1dim_plot.action

Definition at line 31 of file 1dim_plot.py.

1dim_plot.args = parser.parse_args()

Definition at line 45 of file 1dim_plot.py.

1dim_plot.ax = fig.add_subplot(111)

Definition at line 99 of file 1dim_plot.py.

1dim_plot.bbox_inches

Definition at line 148 of file 1dim_plot.py.

1dim_plot.bbox_to_anchor

Definition at line 139 of file 1dim_plot.py.

1dim_plot.color

Definition at line 133 of file 1dim_plot.py.

1dim_plot.data = np.zeros((results.shape[0], len(keys)))

Definition at line 104 of file 1dim_plot.py.

1dim_plot.default

Definition at line 37 of file 1dim_plot.py.

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

Definition at line 98 of file 1dim_plot.py.

1dim_plot.float

Definition at line 33 of file 1dim_plot.py.

1dim_plot.format

Definition at line 148 of file 1dim_plot.py.

1dim_plot.help

Definition at line 31 of file 1dim_plot.py.

1dim_plot.int

Definition at line 36 of file 1dim_plot.py.

1dim_plot.keys = results.dtype.names

Definition at line 103 of file 1dim_plot.py.

1dim_plot.loc

Definition at line 139 of file 1dim_plot.py.

1dim_plot.max = get_max(np.abs(ys))

Definition at line 126 of file 1dim_plot.py.

1dim_plot.metavar

Definition at line 43 of file 1dim_plot.py.

1dim_plot.nargs

Definition at line 43 of file 1dim_plot.py.

1dim_plot.ncol

Definition at line 140 of file 1dim_plot.py.

1dim_plot.o

Definition at line 156 of file 1dim_plot.py.

1dim_plot.parser = argparse.ArgumentParser(description='Plot one-dimensional graphs')

Definition at line 28 of file 1dim_plot.py.

1dim_plot.required

Definition at line 42 of file 1dim_plot.py.

1dim_plot.results = np.genfromtxt(target_file, delimiter=',', names=True)

Definition at line 102 of file 1dim_plot.py.

1dim_plot.simulator = target_file.split('_')[-1].split('.csv')[0].split('.')[-1]

Definition at line 130 of file 1dim_plot.py.

1dim_plot.str

Definition at line 38 of file 1dim_plot.py.

1dim_plot.True

Definition at line 42 of file 1dim_plot.py.

1dim_plot.type

Definition at line 33 of file 1dim_plot.py.

string 1dim_plot.xlabel = DIM_LABELS[keys[args.x]]

Definition at line 115 of file 1dim_plot.py.

1dim_plot.xs = np.array(data[:, args.x])

Definition at line 108 of file 1dim_plot.py.

string 1dim_plot.ylabel = DIM_LABELS[keys[args.y]]

Definition at line 116 of file 1dim_plot.py.

1dim_plot.ymax

Definition at line 135 of file 1dim_plot.py.

1dim_plot.ymin

Definition at line 135 of file 1dim_plot.py.

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

Definition at line 109 of file 1dim_plot.py.

1dim_plot.ys_dev = None

Definition at line 110 of file 1dim_plot.py.