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

Method update_preview_spectrum_plot

pyxrf/model/lineplot.py:1619–1640  ·  view source on GitHub ↗

Update spectrum preview plot based on available/selected dataset and `hide` flag. Parameters ---------- hide: bool `False` - plot data if datasets are available and at least one dataset is selected, otherwise hide the plot, `True` - hide the

(self, *, hide=False)

Source from the content-addressed store, hash-verified

1617 self._fig_preview.set_visible(False)
1618
1619 def update_preview_spectrum_plot(self, *, hide=False):
1620 """
1621 Update spectrum preview plot based on available/selected dataset and `hide` flag.
1622
1623 Parameters
1624 ----------
1625 hide: bool
1626 `False` - plot data if datasets are available and at least one dataset is selected,
1627 otherwise hide the plot, `True` - hide the plot in any case
1628 """
1629 # Find out if any data is selected
1630 show_plot = False
1631 if self.io_model.data_sets:
1632 show_plot = any([_.selected_for_preview for _ in self.io_model.data_sets.values()])
1633 logger.debug(f"LinePlotModel.update_preview_spectrum_plot(): show_plot={show_plot} hide={hide}")
1634 if show_plot and not hide:
1635 logger.debug("LinePlotModel.update_preview_spectrum_plot(): plotting existing datasets")
1636 self._show_preview_spectrum_plot()
1637 else:
1638 logger.debug("LinePlotModel.update_preview_spectrum_plot(): hiding plots")
1639 self._hide_preview_spectrum_plot()
1640 self._fig_preview.canvas.draw()
1641
1642 # ===========================================================================================
1643 # Plotting the preview of Total Count Maps

Callers

nothing calls this directly

Calls 3

valuesMethod · 0.80

Tested by

no test coverage detected