(dat, iabscissa, foffset)
helper function for `plot()` that plots all what is
        in the upper left subplot like fitness, sigma, etc.

        Arguments
        ---------
            `iabscissa` in ``(0,1)``
                0==versus fevals, 1==versus iteration
            `foffset`
                offset to fitness for log-plot

         :See: `plot()`
helper function for `plot()` that plots all what is
        in the upper left subplot like fitness, sigma, etc.
helper function for plot () that plots all what is in the upper left subplot like fitness sigma etc .
def plotdivers(dat, iabscissa, foffset):
        """helper function for `plot()` that plots all what is
        in the upper left subplot like fitness, sigma, etc.

        Arguments
        ---------
            `iabscissa` in ``(0,1)``
                0==versus fevals, 1==versus iteration
            `foffset`
                offset to fitness for log-plot

         :See: `plot()`

        """
        from  matplotlib.pylab import semilogy, hold, grid, \
                 axis, title, text
        fontsize = pylab.rcParams['font.size']

        hold(False)

        dfit = dat.f[:,5]-min(dat.f[:,5])
        dfit[dfit<1e-98] = np.NaN

        if dat.f.shape[1] > 7:
            # semilogy(dat.f[:, iabscissa], abs(dat.f[:,[6, 7, 10, 12]])+foffset,'-k')
            semilogy(dat.f[:, iabscissa], abs(dat.f[:,[6, 7]])+foffset,'-k')
            hold(True)

        # (larger indices): additional fitness data, for example constraints values
        if dat.f.shape[1] > 8:
            # dd = abs(dat.f[:,7:]) + 10*foffset
            # dd = np.where(dat.f[:,7:]==0, np.NaN, dd) # cannot be
            semilogy(dat.f[:, iabscissa], np.abs(dat.f[:,8:]) + 10*foffset, 'm')
            hold(True)

        idx = np.where(dat.f[:,5]>1e-98)[0]  # positive values
        semilogy(dat.f[idx, iabscissa], dat.f[idx,5]+foffset, '.b')
        hold(True)
        grid(True)

        idx = np.where(dat.f[:,5] < -1e-98)  # negative values
        semilogy(dat.f[idx, iabscissa], abs(dat.f[idx,5])+foffset,'.r')

        semilogy(dat.f[:, iabscissa],abs(dat.f[:,5])+foffset,'-b')
        semilogy(dat.f[:, iabscissa], dfit, '-c')

        if 11 < 3:  # delta-fitness as points
            dfit = dat.f[1:, 5] - dat.f[:-1,5]  # should be negative usually
            semilogy(dat.f[1:,iabscissa],  # abs(fit(g) - fit(g-1))
                np.abs(dfit)+foffset, '.c')
            i = dfit > 0
            # print(np.sum(i) / float(len(dat.f[1:,iabscissa])))
            semilogy(dat.f[1:,iabscissa][i],  # abs(fit(g) - fit(g-1))
                np.abs(dfit[i])+foffset, '.r')

        # overall minimum
        i = np.argmin(dat.f[:,5])
        semilogy(dat.f[i, iabscissa]*np.ones(2), dat.f[i,5]*np.ones(2), 'rd')
        # semilogy(dat.f[-1, iabscissa]*np.ones(2), dat.f[-1,4]*np.ones(2), 'rd')

        # AR and sigma
        semilogy(dat.f[:, iabscissa], dat.f[:,3], '-r') # AR
        semilogy(dat.f[:, iabscissa], dat.f[:,2],'-g') # sigma
        semilogy(dat.std[:-1, iabscissa], np.vstack([list(map(max, dat.std[:-1,5:])), list(map(min, dat.std[:-1,5:]))]).T,
                     '-m', linewidth=2)
        text(dat.std[-2, iabscissa], max(dat.std[-2, 5:]), 'max std', fontsize=fontsize)
        text(dat.std[-2, iabscissa], min(dat.std[-2, 5:]), 'min std', fontsize=fontsize)
        ax = array(axis())
        # ax[1] = max(minxend, ax[1])
        axis(ax)
        text(ax[0]+0.01, ax[2], # 10**(log10(ax[2])+0.05*(log10(ax[3])-log10(ax[2]))),
             '.f_recent=' + repr(dat.f[-1,5]) )

        # title('abs(f) (blue), f-min(f) (cyan), Sigma (green), Axis Ratio (red)')
        title('blue:abs(f), cyan:f-min(f), green:sigma, red:axis ratio', fontsize=fontsize-1)
def plotdivers ( dat , iabscissa , foffset ) : from matplotlib . pylab import semilogy , hold , grid , axis , title , text fontsize = pylab . rcParams [ 'font.size' ] hold ( False ) dfit = dat . f [ : , 5 ] - min ( dat . f [ : , 5 ] ) dfit [ dfit < 1e-98 ] = np . NaN if dat . f . shape [ 1 ] > 7 : # semilogy(dat.f[:, iabscissa], abs(dat.f[:,[6, 7, 10, 12]])+foffset,'-k') semilogy ( dat . f [ : , iabscissa ] , abs ( dat . f [ : , [ 6 , 7 ] ] ) + foffset , '-k' ) hold ( True ) # (larger indices): additional fitness data, for example constraints values if dat . f . shape [ 1 ] > 8 : # dd = abs(dat.f[:,7:]) + 10*foffset # dd = np.where(dat.f[:,7:]==0, np.NaN, dd) # cannot be semilogy ( dat . f [ : , iabscissa ] , np . abs ( dat . f [ : , 8 : ] ) + 10 * foffset , 'm' ) hold ( True ) idx = np . where ( dat . f [ : , 5 ] > 1e-98 ) [ 0 ] # positive values semilogy ( dat . f [ idx , iabscissa ] , dat . f [ idx , 5 ] + foffset , '.b' ) hold ( True ) grid ( True ) idx = np . where ( dat . f [ : , 5 ] < - 1e-98 ) # negative values semilogy ( dat . f [ idx , iabscissa ] , abs ( dat . f [ idx , 5 ] ) + foffset , '.r' ) semilogy ( dat . f [ : , iabscissa ] , abs ( dat . f [ : , 5 ] ) + foffset , '-b' ) semilogy ( dat . f [ : , iabscissa ] , dfit , '-c' ) if 11 < 3 : # delta-fitness as points dfit = dat . f [ 1 : , 5 ] - dat . f [ : - 1 , 5 ] # should be negative usually semilogy ( dat . f [ 1 : , iabscissa ] , # abs(fit(g) - fit(g-1)) np . abs ( dfit ) + foffset , '.c' ) i = dfit > 0 # print(np.sum(i) / float(len(dat.f[1:,iabscissa]))) semilogy ( dat . f [ 1 : , iabscissa ] [ i ] , # abs(fit(g) - fit(g-1)) np . abs ( dfit [ i ] ) + foffset , '.r' ) # overall minimum i = np . argmin ( dat . f [ : , 5 ] ) semilogy ( dat . f [ i , iabscissa ] * np . ones ( 2 ) , dat . f [ i , 5 ] * np . ones ( 2 ) , 'rd' ) # semilogy(dat.f[-1, iabscissa]*np.ones(2), dat.f[-1,4]*np.ones(2), 'rd') # AR and sigma semilogy ( dat . f [ : , iabscissa ] , dat . f [ : , 3 ] , '-r' ) # AR semilogy ( dat . f [ : , iabscissa ] , dat . f [ : , 2 ] , '-g' ) # sigma semilogy ( dat . std [ : - 1 , iabscissa ] , np . vstack ( [ list ( map ( max , dat . std [ : - 1 , 5 : ] ) ) , list ( map ( min , dat . std [ : - 1 , 5 : ] ) ) ] ) . T , '-m' , linewidth = 2 ) text ( dat . std [ - 2 , iabscissa ] , max ( dat . std [ - 2 , 5 : ] ) , 'max std' , fontsize = fontsize ) text ( dat . std [ - 2 , iabscissa ] , min ( dat . std [ - 2 , 5 : ] ) , 'min std' , fontsize = fontsize ) ax = array ( axis ( ) ) # ax[1] = max(minxend, ax[1]) axis ( ax ) text ( ax [ 0 ] + 0.01 , ax [ 2 ] , # 10**(log10(ax[2])+0.05*(log10(ax[3])-log10(ax[2]))), '.f_recent=' + repr ( dat . f [ - 1 , 5 ] ) ) # title('abs(f) (blue), f-min(f) (cyan), Sigma (green), Axis Ratio (red)') title ( 'blue:abs(f), cyan:f-min(f), green:sigma, red:axis ratio' , fontsize = fontsize - 1 )