Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
return ax
elif kind == 'altair':
plot_dict = {}
if Z_data is not None and f_data is not None:
plot_dict['data'] = {'f': f_data, 'Z': Z_data}
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)
if self.name is not None:
name = self.name
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)
return ax
elif kind == 'altair':
plot_dict = {}
if Z_data is not None and f_data is not None:
plot_dict['data'] = {'f': f_data, 'Z': Z_data}