Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #482 from brechmos-stsci/i475-default-region-size
Browse files Browse the repository at this point in the history
Reworked the default region size
  • Loading branch information
javerbukh committed Oct 24, 2018
2 parents d945324 + b7cf03a commit 9e7e1cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions specviz/widgets/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,11 @@ def _on_add_linear_region(self, min_bound=None, max_bound=None):
disp_axis = self.getAxis('bottom')
mid_point = disp_axis.range[0] + (disp_axis.range[1] -
disp_axis.range[0]) * 0.5
disp_range = disp_axis.range[1] - disp_axis.range[0]

region = LinearRegionItem(
values=(min_bound or (disp_axis.range[0] + mid_point * 0.75),
max_bound or (disp_axis.range[1] - mid_point * 0.75)))
values=(min_bound or (mid_point - disp_range*0.3),
max_bound or (mid_point + disp_range*0.3)))

def _on_region_updated(new_region):
# If the most recently selected region is already the currently
Expand Down

0 comments on commit 9e7e1cc

Please sign in to comment.