def plot_pathline(self, pl, **kwargs):
        """
        Plot the MODPATH pathlines.

        Parameters
        ----------
        pl : list of rec arrays or a single rec array
            rec array or list of rec arrays is data returned from
            modpathfile PathlineFile get_data() or get_alldata()
            methods. Data in rec array is 'x', 'y', 'z', 'time',
            'k', and 'particleid'.

        kwargs : layer, ax, colors.  The remaining kwargs are passed
            into the LineCollection constructor. If layer='all',
            pathlines are output for all layers

        Returns
        -------
        lc : matplotlib.collections.LineCollection

        """
        from matplotlib.collections import LineCollection
        #make sure pathlines is a list
        if isinstance(pl, np.ndarray):
            pl = [pl]
        
        if 'layer' in kwargs:
            kon = kwargs.pop('layer')
            if isinstance(kon, str):
                if kon.lower() == 'all':
                    kon = -1
                else:
                    kon = self.layer
        else:
            kon = self.layer

        if 'ax' in kwargs:
            ax = kwargs.pop('ax')
        else:
            ax = self.ax

        if 'colors' not in kwargs:
            kwargs['colors'] = '0.5'

        linecol = []
        for p in pl:
            vlc = []
            #rotate data
            x0r, y0r = self.sr.rotate(p['x'], p['y'], self.sr.rotation, 0., self.sr.yedge[0])
            x0r += self.sr.xul
            y0r += self.sr.yul - self.sr.yedge[0]
            #build polyline array
            arr = np.vstack((x0r, y0r)).T
            #select based on layer
            if kon >= 0:
                arr = np.ma.masked_where((p['k'] != kon), arr)
            #append line to linecol if there is some unmasked segment
            if not arr.mask.all():
                linecol.append(arr)
        #create line collection
        lc = None
        if len(linecol) > 0:
            lc = LineCollection(linecol, **kwargs)
            ax.add_collection(lc)
        return lc
dataset/ETHPy150Open modflowpy/flopy/flopy/plot/map.py/ModelMap.plot_pathline/original