MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / plot_roi_bound

Method plot_roi_bound

pyxrf/model/lineplot.py:1077–1104  ·  view source on GitHub ↗

Plot roi with low, high and ceter value.

(self)

Source from the content-addressed store, hash-verified

1075 self._update_canvas()
1076
1077 def plot_roi_bound(self):
1078 """
1079 Plot roi with low, high and ceter value.
1080 """
1081 for k, v in self.roi_plot_dict.items():
1082 for data in v:
1083 data.remove()
1084 self.roi_plot_dict.clear()
1085
1086 if len(self.roi_dict):
1087 # self._ax.hold(True)
1088 for k, v in self.roi_dict.items():
1089 temp_list = []
1090 for linev in np.array([v.left_val, v.line_val, v.right_val]) / 1000.0:
1091 (lineplot,) = self._ax.plot(
1092 [linev, linev],
1093 [0, 1 * self.max_v],
1094 color=self.plot_style["roi_line"]["color"],
1095 linewidth=self.plot_style["roi_line"]["linewidth"],
1096 )
1097 if v.show_plot:
1098 lineplot.set_visible(True)
1099 else:
1100 lineplot.set_visible(False)
1101 temp_list.append(lineplot)
1102 self.roi_plot_dict.update({k: temp_list})
1103
1104 self._update_canvas()
1105
1106 @observe("roi_dict")
1107 def show_roi_bound(self, change):

Callers 6

show_roi_boundMethod · 0.95
show_roiMethod · 0.80
change_roiMethod · 0.80

Calls 4

_update_canvasMethod · 0.95
itemsMethod · 0.80
clearMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected