Skip to content
Snippets Groups Projects
Commit ba043c31 authored by Michael Pawelzik's avatar Michael Pawelzik
Browse files

spare trace in measurment plot subplot 1 for plotting extra trace

-> actually used for postplot analysis (correlation/regression)
parent 066bc568
No related branches found
No related tags found
1 merge request!3feat: introduce external sensors
...@@ -11,7 +11,7 @@ class PlottingError(Exception): ...@@ -11,7 +11,7 @@ class PlottingError(Exception):
pass pass
class MeasurementPlot: class MeasurementPlot:
def __init__(self, title='', legend_loc = 'lower right', legend_bbox_to_anchor = None): def __init__(self, title='', legend_loc = 'upper left', legend_bbox_to_anchor = (1.09, 1)):
# set python for opening an separate plot window when starting from anaconda, Michael # set python for opening an separate plot window when starting from anaconda, Michael
if 'ipykernel' in sys.modules: if 'ipykernel' in sys.modules:
from IPython import get_ipython from IPython import get_ipython
...@@ -29,6 +29,7 @@ class MeasurementPlot: ...@@ -29,6 +29,7 @@ class MeasurementPlot:
# First plot: Phase and magnitude, Michael # First plot: Phase and magnitude, Michael
self.path_collection_phase = self.ax1[0].scatter([], [], c='red', marker='<', label='DUT Phase') self.path_collection_phase = self.ax1[0].scatter([], [], c='red', marker='<', label='DUT Phase')
self.path_collection_fit = self.ax1[0].scatter([], [], c='green', marker='.', label = ' ')
self.magnitude_axis = self.ax1[0].twinx() self.magnitude_axis = self.ax1[0].twinx()
# in entry of legend for phase and magnitude the word DUT is added in front, Michael # in entry of legend for phase and magnitude the word DUT is added in front, Michael
...@@ -47,9 +48,10 @@ class MeasurementPlot: ...@@ -47,9 +48,10 @@ class MeasurementPlot:
self.equi_axis0.set_ylim(-1, 32) self.equi_axis0.set_ylim(-1, 32)
self.ax1[0].grid(True, linestyle=":") self.ax1[0].grid(True, linestyle=":")
all_path_collections = [self.path_collection_phase, self.path_collection_mag, self.path_collection_equi0] all_path_collections = [self.path_collection_phase, self.path_collection_mag, \
self.path_collection_equi0, self.path_collection_fit]
labels = [pc.get_label() for pc in all_path_collections] labels = [pc.get_label() for pc in all_path_collections]
self.ax1[0].legend(all_path_collections, labels, loc=self.legend_loc, bbox_to_anchor = \ self.phase_legend = self.ax1[0].legend(all_path_collections, labels, loc=self.legend_loc, bbox_to_anchor = \
self.legend_bbox_to_anchor) self.legend_bbox_to_anchor)
ax = self.fig.axes ax = self.fig.axes
...@@ -188,6 +190,7 @@ class MeasurementPlot: ...@@ -188,6 +190,7 @@ class MeasurementPlot:
minimum, maximum = self.get_extended_min_max(phases) minimum, maximum = self.get_extended_min_max(phases)
self.ax1[0].set_ylim(minimum, maximum) self.ax1[0].set_ylim(minimum, maximum)
self.path_collection_phase.set_offsets(np.c_[timestamps, phases]) self.path_collection_phase.set_offsets(np.c_[timestamps, phases])
self.path_collection_fit.set_offsets(np.c_[[], []])
# refresh data for magnitude in subplot for phase and magnitude # refresh data for magnitude in subplot for phase and magnitude
magnitudes = data_frame.S21_MAGNITUDE magnitudes = data_frame.S21_MAGNITUDE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment