(self, plot_cmd=None, tf=lambda y: y)
return self
plot the data we have, return ``self``
plot the data we have, return ``self``
plot the data we have return self
def plot(self, plot_cmd=None, tf=lambda y: y):
        """plot the data we have, return ``self``"""
        if not plot_cmd:
            plot_cmd = self.plot_cmd
        colors = 'bgrcmyk'
        pylab.hold(False)
        res = self.res

        flatx, flatf = self.flattened()
        minf = np.inf
        for i in flatf:
            minf = min((minf, min(flatf[i])))
        addf = 1e-9 - minf  if minf <= 0 else 0
        for i in sorted(res.keys()):  # we plot not all values here
            if type(i) is int:
                color = colors[i % len(colors)]
                arx = sorted(res[i].keys())
                plot_cmd(arx, [tf(np.median(res[i][x]) + addf) for x in arx], color + '-')
                pylab.text(arx[-1], tf(np.median(res[i][arx[-1]])), i)
                pylab.hold(True)
                plot_cmd(flatx[i], tf(np.array(flatf[i]) + addf), color + 'o')
        pylab.ylabel('f + ' + str(addf))
        pylab.draw()
        show()
        # raw_input('press return')
        return self
def plot ( self , plot_cmd = None , tf = lambda y : y ) : if not plot_cmd : plot_cmd = self . plot_cmd colors = 'bgrcmyk' pylab . hold ( False ) res = self . res flatx , flatf = self . flattened ( ) minf = np . inf for i in flatf : minf = min ( ( minf , min ( flatf [ i ] ) ) ) addf = 1e-9 - minf if minf <= 0 else 0 for i in sorted ( res . keys ( ) ) : # we plot not all values here if type ( i ) is int : color = colors [ i % len ( colors ) ] arx = sorted ( res [ i ] . keys ( ) ) plot_cmd ( arx , [ tf ( np . median ( res [ i ] [ x ] ) + addf ) for x in arx ] , color + '-' ) pylab . text ( arx [ - 1 ] , tf ( np . median ( res [ i ] [ arx [ - 1 ] ] ) ) , i ) pylab . hold ( True ) plot_cmd ( flatx [ i ] , tf ( np . array ( flatf [ i ] ) + addf ) , color + 'o' ) pylab . ylabel ( 'f + ' + str ( addf ) ) pylab . draw ( ) show ( ) # raw_input('press return') return self