Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_background_line(self):
self.bg_line = drawing.signal1d.Signal1DLine()
self.bg_line.data_function = self.bg_to_plot
self.bg_line.set_line_properties(
color='blue',
type='line',
scaley=False)
self.signal._plot.signal_plot.add_line(self.bg_line)
self.bg_line.autoscale = False
self.bg_line.plot()
def plot(self):
if self.signal._plot is None or not self.signal._plot.is_active:
self.signal.plot()
hse = self.signal._plot
l1 = hse.signal_plot.ax_lines[0]
self.original_color = l1.line.get_color()
l1.set_line_properties(color=self.original_color,
type='scatter')
l2 = drawing.signal1d.Signal1DLine()
l2.data_function = self.model2plot
l2.set_line_properties(
color=self.line_color_rgb,
type='line')
# Add the line to the figure
hse.signal_plot.add_line(l2)
l2.plot()
self.data_line = l1
self.smooth_line = l2
self.smooth_diff_line = None
def create_interpolation_line(self):
self.interpolated_line = drawing.signal1d.Signal1DLine()
self.interpolated_line.data_function = self.get_interpolated_spectrum
self.interpolated_line.set_line_properties(
color='blue',
type='line')
self.signal._plot.signal_plot.add_line(self.interpolated_line)
self.interpolated_line.autoscale = False
self.interpolated_line.plot()
def create_remainder_line(self):
self.rm_line = drawing.signal1d.Signal1DLine()
self.rm_line.data_function = self.rm_to_plot
self.rm_line.set_line_properties(
color='green',
type='line',
scaley=False)
self.signal._plot.signal_plot.add_line(self.rm_line)
self.rm_line.autoscale = False
self.rm_line.plot()
def create_interpolation_line(self):
self.interpolated_line = drawing.signal1d.Signal1DLine()
self.interpolated_line.data_function = self.get_interpolated_spectrum
self.interpolated_line.set_line_properties(
color='blue',
type='line')
self.signal._plot.signal_plot.add_line(self.interpolated_line)
self.interpolated_line.auto_update = False
self.interpolated_line.autoscale = False
self.interpolated_line.plot()
def create_background_line(self):
self.bg_line = drawing.signal1d.Signal1DLine()
self.bg_line.data_function = self.bg_to_plot
self.bg_line.set_line_properties(
color='blue',
type='line',
scaley=False)
self.signal._plot.signal_plot.add_line(self.bg_line)
self.bg_line.autoscale = False
self.bg_line.plot()
def _plot_component(self, component):
line = hyperspy.drawing.signal1d.Signal1DLine()
line.data_function = component._component2plot
# Add the line to the figure
self._plot.signal_plot.add_line(line)
line.plot()
component._model_plot_line = line
self._connect_component_line(component)