Skip to content
Snippets Groups Projects

Fix gps lk unlk plotting - coloring, positioning label

Merged Lan Dam requested to merge i109_fix_GPS_lk_unlk_plotting into master
2 files
+ 51
33
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -77,8 +77,10 @@ class Plotting:
if chan_db_info['valueColors'] in [None, 'None', '']:
chan_db_info['valueColors'] = '*:W'
value_colors = chan_db_info['valueColors'].split('|')
colors = []
for vc in value_colors:
v, c = vc.split(':')
colors.append(c)
val = get_val(v)
if c == '_':
prev_val = val
@@ -106,9 +108,14 @@ class Plotting:
total_samples = len(x)
x = sorted(x)
if len(colors) != 1:
sample_no_colors = [clr['W']]
else:
sample_no_colors = [clr[colors[0]]]
self.plotting_axes.set_axes_info(
ax, [total_samples], chan_db_info=chan_db_info,
linked_ax=linked_ax)
ax, [total_samples], sample_no_colors=sample_no_colors,
chan_db_info=chan_db_info, linked_ax=linked_ax)
if linked_ax is None:
ax.x = x
else:
@@ -170,6 +177,7 @@ class Plotting:
ax.set_ylim(-2, 2)
self.plotting_axes.set_axes_info(
ax, [len(points_list[0]), len(points_list[1])],
sample_no_colors=colors,
chan_db_info=chan_db_info, linked_ax=linked_ax)
if linked_ax is None:
ax.x = x
@@ -205,7 +213,8 @@ class Plotting:
x_list = c_data['times']
total_x = sum([len(x) for x in x_list])
self.plotting_axes.set_axes_info(
ax, [total_x], chan_db_info=chan_db_info, linked_ax=linked_ax)
ax, [total_x], sample_no_colors=[clr[color]],
chan_db_info=chan_db_info, linked_ax=linked_ax)
for x in x_list:
ax.plot(x, [0] * len(x), marker='s', markersize=1.5,
@@ -252,15 +261,7 @@ class Plotting:
self.parent.plotting_bot, plot_h)
x_list, y_list = c_data['times'], c_data['data']
if chan_id == 'GPS Lk/Unlk':
sample_no_list = []
sample_no_list.append(np.where(y_list[0] == -1)[0].size)
sample_no_list.append(np.where(y_list[0] == 1)[0].size)
else:
sample_no_list = [sum([len(x) for x in x_list])]
self.plotting_axes.set_axes_info(
ax, sample_no_list, chan_db_info=chan_db_info,
info=info, y_list=y_list, linked_ax=linked_ax)
colors = {}
if chan_db_info['valueColors'] not in [None, 'None', '']:
color_parts = chan_db_info['valueColors'].split('|')
@@ -274,6 +275,20 @@ class Plotting:
if 'D' in colors:
d_color = colors['D']
has_dot = True
if chan_id == 'GPS Lk/Unlk':
sample_no_list = []
sample_no_list.append(np.where(y_list[0] == -1)[0].size)
sample_no_list.append(np.where(y_list[0] == 1)[0].size)
sample_no_colors = [clr[d_color], clr[d_color]]
else:
sample_no_list = [sum([len(x) for x in x_list])]
sample_no_colors = [clr[d_color]]
self.plotting_axes.set_axes_info(
ax, sample_no_list, sample_no_colors=sample_no_colors,
chan_db_info=chan_db_info,
info=info, y_list=y_list, linked_ax=linked_ax)
for x, y in zip(x_list, y_list):
if not has_dot:
# set marker to be able to click point for info
Loading