def plot_drainage_curve(self,
                            data=None,
                            x_values='capillary_pressure',
                            y_values='invading_phase_saturation'):
        r"""
        Plot the drainage curve as the non-wetting phase saturation vs the
        applied capillary pressure.

        Parameters
        ----------
        data : dictionary of arrays
            This dictionary should be obtained from the ``get_drainage_data``
            method.

        x_values and y_values : string
            The dictionary keys of the arrays containing the x-values and
            y-values

        """
        # Begin creating nicely formatted plot
        if data is None:
            data = self.get_drainage_data()
        xdata = data[x_values]
        ydata = data[y_values]
        fig = plt.figure()
        plt.plot(xdata, ydata, 'ko-')
        plt.ylabel(y_values)
        plt.xlabel(x_values)
        plt.grid(True)
        if sp.amax(xdata) <= 1:
            plt.xlim(xmin=0, xmax=1)
        if sp.amax(ydata) <= 1:
            plt.ylim(ymin=0, ymax=1)
        return fig
dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__Drainage__.py/Drainage.plot_drainage_curve/original