Commit 2d347041 authored by Paul's avatar Paul
Browse files

Bugfixes in circlefit plotting

parent 27c9816d
......@@ -114,7 +114,7 @@ def plot_rawdata(freq, data, title='-', engine='bokeh'):
plt.xlim([freq[0], freq[-1]])
def plot_cfit(circuit, engine='bokeh', title=''):
def plot_cfit(circuit, engine='bokeh', title='',fig=None):
"""
Plot the data and fit.
"""
......@@ -258,7 +258,11 @@ def plot_cfit(circuit, engine='bokeh', title=''):
show(fig)
elif engine in ['pyplot', 'p']:
fig = plt.figure(dpi=150, figsize=(8.5,8.5))
if not fig:
try:
fig = plt.gcf()
except:
fig = plt.figure(dpi=150, figsize=(8.5,8.5))
fig.suptitle(title)
fig.subplots_adjust(wspace=0.35, hspace=0.35) # Ensure space for label
# Magnitude
......@@ -314,7 +318,7 @@ def plot_cfit(circuit, engine='bokeh', title=''):
x_low = -1.2
x_high = 1.2
y_low = -1.2
x_high = 1.2
y_high = 1.2
plt.xlim([x_low, x_high])
plt.ylim([y_low, y_high])
plt.legend(loc=2)
......
......@@ -255,10 +255,10 @@ class data_complex(data_table):
Chose the plot engine between 'bokeh' (default) and 'pyplot'
"""
# TODO Rewrite without try and except
try:
if self.circuit is not None:
self.plot_fitted_data(engine=engine, **kwargs)
except:
else:
self.plot_rawdata(engine=engine, **kwargs)
def plot_rawdata(self, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment