Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions openmc_plotter/plotgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,18 +946,18 @@ def updateTallyDataIndicatorValue(self, y_val):
return

if self.tally_data_indicator is not None and self.tally_image is not None:
# use norm to get axis value if log scale
if cv.tallyDataLogScale:
y_val = self.tally_image.norm(y_val)

# If indicator value hasn't changed, skip update
if self._last_tally_indicator_value == y_val:
return
self._last_tally_indicator_value = y_val

data = self.tally_data_indicator.get_data()
# Colorbar axes use data coordinates; normalization is only needed
# when mapping the value through the colormap.
self.tally_data_indicator.set_data([data[0], [y_val, y_val]])
dl_color = invert_rgb(self.tally_image.get_cmap()(y_val), True)
normalized_value = self.tally_image.norm(y_val)
dl_color = invert_rgb(
self.tally_image.get_cmap()(normalized_value), True)
self.tally_data_indicator.set_c(dl_color)

if not self._blit_indicator(self.tally_data_indicator, self.tally_colorbar):
Expand All @@ -971,18 +971,18 @@ def updateDataIndicatorValue(self, y_val):
return

if self.data_indicator and self.image is not None:
# use norm to get axis value if log scale
if cv.color_scale_log[cv.colorby]:
y_val = self.image.norm(y_val)

# If indicator value hasn't changed, skip update
if self._last_data_indicator_value == y_val:
return
self._last_data_indicator_value = y_val

data = self.data_indicator.get_data()
# Colorbar axes use data coordinates; normalization is only needed
# when mapping the value through the colormap.
self.data_indicator.set_data([data[0], [y_val, y_val]])
dl_color = invert_rgb(self.image.get_cmap()(y_val), True)
normalized_value = self.image.norm(y_val)
dl_color = invert_rgb(
self.image.get_cmap()(normalized_value), True)
self.data_indicator.set_c(dl_color)

if not self._blit_indicator(self.data_indicator, self.property_colorbar):
Expand Down
Loading