Skip to content

Commit

Permalink
fix setting display units for unitless data
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Apr 13, 2023
1 parent c4bb23d commit 7c5394f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jdaviz/configs/specviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ def add_data(self, data, color=None, alpha=None, **layer_state):
result = super().add_data(data, color, alpha, **layer_state)

if reset_plot_axes:
self.state.x_display_unit = data.get_component(self.state.x_att.label).units
self.state.y_display_unit = data.get_component("flux").units
x_units = data.get_component(self.state.x_att.label).units
y_units = data.get_component("flux").units
self.state.x_display_unit = x_units if x_units else None
self.state.y_display_unit = y_units if y_units else None
self.set_plot_axes()

self._plot_uncertainties()
Expand Down

0 comments on commit 7c5394f

Please sign in to comment.