Skip to content
Snippets Groups Projects

correct the way to identify colors for mass pos

Merged Lan Dam requested to merge i157_fix_mass_pos_color into master
@@ -5,6 +5,9 @@ from sohstationviewer.controller.util import get_val
from sohstationviewer.controller.plotting_data import get_masspos_value_colors
from sohstationviewer.view.util.color import clr
from sohstationviewer.view.plotting.plotting_widget.plotting_helper import (
get_colors_sizes_for_abs_y_from_value_colors
)
from sohstationviewer.conf import constants
@@ -378,26 +381,14 @@ class Plotting:
self.plotting_axes.set_axes_info(
ax, [total_x], chan_db_info=chan_db_info, y_list=y_list)
for x, y in zip(x_list, y_list):
# plot to have artist pl.Line2D to get pick
ax.myPlot = ax.plot(x, y,
linestyle='-', linewidth=0.7,
color=self.parent.display_color['sub_basic'],
picker=True, pickradius=3,
zorder=constants.Z_ORDER['LINE'])[0]
colors = [None] * len(y)
sizes = [1.5] * len(y)
for i in range(len(y)):
count = 0
prev_v = 0
for v, c in value_colors:
if count < (len(value_colors) - 1):
if prev_v < abs(y[i]) <= v:
colors[i] = clr[c]
break
else:
colors[i] = clr[c]
break
prev_v = v
count += 1
colors, sizes = get_colors_sizes_for_abs_y_from_value_colors(
y, value_colors)
ax.scatter(x, y, marker='s', c=colors, s=sizes,
zorder=constants.Z_ORDER['DOT'])
ax.x_list = x_list
Loading