diff --git a/glue/viewers/histogram/state.py b/glue/viewers/histogram/state.py index 730a8cfbd..5e2b38754 100644 --- a/glue/viewers/histogram/state.py +++ b/glue/viewers/histogram/state.py @@ -38,6 +38,10 @@ class HistogramViewerState(MatplotlibDataViewerState): common_n_bin = DDCProperty(True, docstring='The number of bins to use for ' 'all numerical components') + x_limits_percentile = DDCProperty(100, docstring="Percentile to use when automatically determining x limits") + + update_bins_on_reset_limits = DDCProperty(True, docstring="Whether to update the bins to match the view when resetting limits") + def __init__(self, **kwargs): super(HistogramViewerState, self).__init__() @@ -67,9 +71,10 @@ def _reset_x_limits(self, *args): if self.x_att is None: return with delay_callback(self, 'hist_x_min', 'hist_x_max', 'x_min', 'x_max', 'x_log'): - self.x_lim_helper.percentile = 100 + self.x_lim_helper.percentile = self.x_limits_percentile self.x_lim_helper.update_values(force=True) - self.update_bins_to_view() + if self.update_bins_on_reset_limits: + self.update_bins_to_view() def reset_limits(self): self._reset_x_limits() diff --git a/glue/viewers/scatter/state.py b/glue/viewers/scatter/state.py index 0ad007bb9..0a6e6ca57 100644 --- a/glue/viewers/scatter/state.py +++ b/glue/viewers/scatter/state.py @@ -30,6 +30,9 @@ class ScatterViewerState(MatplotlibDataViewerState): plot_mode = DDSCProperty(docstring="Whether to plot the data in cartesian, polar or another projection") angle_unit = DDSCProperty(docstring="Whether to use radians or degrees for any angular coordinates") + x_limits_percentile = DDCProperty(100, docstring="Percentile to use when automatically determining x limits") + y_limits_percentile = DDCProperty(100, docstring="Percentile to use when automatically determining y limits") + def __init__(self, **kwargs): super(ScatterViewerState, self).__init__() @@ -70,13 +73,13 @@ def __init__(self, **kwargs): def _reset_x_limits(self, *args): if self.x_att is None: return - self.x_lim_helper.percentile = 100 + self.x_lim_helper.percentile = self.x_limits_percentile self.x_lim_helper.update_values(force=True) def _reset_y_limits(self, *args): if self.y_att is None: return - self.y_lim_helper.percentile = 100 + self.y_lim_helper.percentile = self.y_limits_percentile self.y_lim_helper.update_values(force=True) def reset_limits(self):