How to use the impedance.plotting.plot_nyquist function in impedance

To help you get started, we’ve selected a few impedance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ECSHackWeek / impedance.py / impedance / circuits.py View on Github external
if ax is None:
            fig, ax = plt.subplots(figsize=(5, 5))

        if Z_data is not None:
            ax = plot_nyquist(ax, f_data, Z_data,
                              scale=scale, units=units, fmt='s')

        if self._is_fit():

            if f_data is not None:
                f_pred = f_data
            else:
                f_pred = np.logspace(5, -3)

            Z_fit = self.predict(f_pred)
            ax = plot_nyquist(ax, f_data, Z_fit,
                              scale=scale, units=units, fmt='s')

            base_ylim, base_xlim = ax.get_ylim(), ax.get_xlim()

            if conf_bounds is not None:
                N = 10000
                n = len(self.parameters_)
                f_pred = np.logspace(np.log10(min(f_data)),
                                     np.log10(max(f_data)),
                                     num=100)

                params = self.parameters_
                confs = self.conf_

                full_range = np.ndarray(shape=(N, len(f_pred)), dtype=complex)
                for i in range(N):
github ECSHackWeek / impedance.py / impedance / models / circuits / __init__.py View on Github external
`matplotlib.pyplot.Line2D` properties like linewidth,
             line color, marker color, and labels.
            If kind is 'altair', used to specify nyquist height as `size`

        Returns
        -------
        ax: matplotlib.axes
            axes of the created nyquist plot
        """

        if kind == 'nyquist':
            if ax is None:
                fig, ax = plt.subplots(figsize=(5, 5))

            if Z_data is not None:
                ax = plot_nyquist(ax, Z_data, ls='', marker='s', **kwargs)

            if self._is_fit():
                if f_data is not None:
                    f_pred = f_data
                else:
                    f_pred = np.logspace(5, -3)

                Z_fit = self.predict(f_pred)
                ax = plot_nyquist(ax, Z_fit, ls='-', marker='', **kwargs)
            return ax
        elif kind == 'bode':
            if ax is None:
                fig, ax = plt.subplots(nrows=2, figsize=(5, 5))

            if Z_data is not None:
                ax = plot_bode(ax, f_data, Z_data, ls='', marker='s', **kwargs)
github ECSHackWeek / impedance.py / impedance / models / circuits / __init__.py View on Github external
if kind == 'nyquist':
            if ax is None:
                fig, ax = plt.subplots(figsize=(5, 5))

            if Z_data is not None:
                ax = plot_nyquist(ax, Z_data, ls='', marker='s', **kwargs)

            if self._is_fit():
                if f_data is not None:
                    f_pred = f_data
                else:
                    f_pred = np.logspace(5, -3)

                Z_fit = self.predict(f_pred)
                ax = plot_nyquist(ax, Z_fit, ls='-', marker='', **kwargs)
            return ax
        elif kind == 'bode':
            if ax is None:
                fig, ax = plt.subplots(nrows=2, figsize=(5, 5))

            if Z_data is not None:
                ax = plot_bode(ax, f_data, Z_data, ls='', marker='s', **kwargs)

            if self._is_fit():
                if f_data is not None:
                    f_pred = f_data
                else:
                    f_pred = np.logspace(5, -3)

                Z_fit = self.predict(f_pred)
                ax = plot_bode(ax, f_pred, Z_fit, ls='-', marker='', **kwargs)
github ECSHackWeek / impedance.py / impedance / circuits.py View on Github external
fit model shown as either error bars or a filled confidence area.
            Confidence bands are estimated by simulating the spectra for 10000
            randomly sampled parameter sets where each of the parameters is
            sampled from a normal distribution

        Returns
        -------
        ax: matplotlib.axes
            axes of the created nyquist plot
        """

        if ax is None:
            fig, ax = plt.subplots(figsize=(5, 5))

        if Z_data is not None:
            ax = plot_nyquist(ax, f_data, Z_data,
                              scale=scale, units=units, fmt='s')

        if self._is_fit():

            if f_data is not None:
                f_pred = f_data
            else:
                f_pred = np.logspace(5, -3)

            Z_fit = self.predict(f_pred)
            ax = plot_nyquist(ax, f_data, Z_fit,
                              scale=scale, units=units, fmt='s')

            base_ylim, base_xlim = ax.get_ylim(), ax.get_xlim()

            if conf_bounds is not None: