def METHOD_NAME(title, p1, p2, zaxis,
                             local_points_array, global_points_array, result_array,
                             csv_filename=None, invert_yaxis=False, plot=True, show=True):
    """for edges"""
    local_x = local_points_array[:, 0]
    is_complex = np.iscomplexobj(result_array)
    global_x = global_points_array[:, 0]
    global_y = global_points_array[:, 1]
    global_z = global_points_array[:, 2]
    #x = local_points_array[:, 0]
    #y = local_points_array[:, 1]
    nrows, ncols = result_array.shape
    assert ncols == 8, result_array.shape
    ncp = ncols - 7
    nresult_cols = ncp
    if is_complex:
        nresult_cols = 2 * ncp
    cp = result_array[:, -1]
    if plot:
        assert IS_MATPLOTLIB, IS_MATPLOTLIB
        plt.close()
        fig = plt.figure(1)
        ax = fig.add_subplot(1, 1, 1)
        colors = ['C0<', 'C1>'] if MPL_VER >= [2, 1] else ['b>', 'r<']
        ax.plot(local_x, cp.real, colors[0], label='real')
        if is_complex:
            ax.plot(local_x, cp.imag, colors[0], label='imag')
        ax.set_xlabel('Local X')
        ax.set_ylabel(title)
        ax.legend()
        ax.grid(True)
        if invert_yaxis:
            ax.invert_yaxis()
        fig = plt.figure(2)
        plt.plot(global_x, global_y, 'o')
        plt.xlabel('X')
        plt.ylabel('Y')
        plt.grid(True)
        fig = plt.figure(3)
        plt.plot(global_x, global_z, 'o')
        plt.xlabel('X')
        plt.ylabel('Z')
        plt.grid(True)
    if csv_filename is None:
        if plot and show:
            plt.show()
        return
    #for body in bodies:
    #with open(csv_filename, 'w') as csv_file:
    #Cp = result_array[:, 3:]
    nd_msg = ''
    # x, y, z, Cp
    result_array2 = np.zeros((nrows, 6 + nresult_cols), dtype='float64')
    # xyz
    result_array2[:, :3] = global_points_array
    result_array2[:, 3:6] = local_points_array
    if is_complex:
        if ncp > 1:
            nd_msg = ' (real, imag for each component)'
        # convert to float64
        header = (
            'cut 1\n'
            'p1: %s\n'
            'p2: %s\n'
            'zaxis manual: %s\n'
            'x, y, z, x_local, y_local, z_local, %s_real, %s_imag%s\n' % (
                str(p1), str(p2), str(zaxis),
                title, title, nd_msg)
        )
        # Cp
        for i in range(ncp):
            result_array2[:, 6 + 2*i] = cp.real
            result_array2[:, 7 + 2*i] = cp.imag
    else:
        if ncp > 1:
            nd_msg = ' (each component)'
        result_array2[:, -ncp] = result_array[:, -ncp]
        header = (
            'cut 1\n'
            'p1: %s\n'
            'p2: %s\n'
            'zaxis manual: %s\n'
            'x, y, z, x_local, y_local, z_local, %s%s\n' % (
                str(p1), str(p2), str(zaxis), title, nd_msg)
        )
    # encoding=None - added in numpy 1.14
    np.savetxt(csv_filename, result_array2, delimiter=',', header=header, comments='# ',)
    if plot and show:
        plt.show()