def plot(self, logarithmic=False):
"""Plot a graphical representation of the peaks
Arguments:
(none)
"""
import pylab as pl
pl.figure()
pl.plot(self.x)
pl.hold('on')
pl.plot(self.pos[self.keep], self.val[self.keep], 'og')
pl.plot(self.pos[np.logical_not(self.keep)],
self.val[np.logical_not(self.keep)], 'om')
if hasattr(self, 'bounds'):
lmins = np.unique(self.bounds.flatten())
lminvals = self.x[lmins]
pl.plot(lmins, lminvals, 'or')
if hasattr(self, 'fpos'):
pl.plot(self.fpos[self.keep], self.fval[self.keep], 'dg')
pl.hold('off')
if logarithmic:
pl.gca().set_yscale('log')
评论列表
文章目录