Skip to content

Commit

Permalink
gwsumm.plot: add support for sortbycolor (#333)
Browse files Browse the repository at this point in the history
in trigger plots

Co-authored-by: Alex Urban <alexander.urban@ligo.org>

Co-authored-by: Alex Urban <alexander.urban@ligo.org>
  • Loading branch information
duncanmmacleod and Alex Urban authored Nov 26, 2022
1 parent d97665d commit 3bfdb2b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions gwsumm/plot/triggers/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def main(args=None):
'cmap': get_plot('triggers').defaults.get('cmap', 'YlGnBu'),
'clim': (3, 50),
'colorlabel': 'Signal-to-noise ratio (SNR)',
'sortbycolor': True,
}

# update with user params
Expand Down Expand Up @@ -234,8 +235,16 @@ def main(args=None):

# format keywords for plot creation
plot_kw = OrderedDict(
(key, params.pop(key)) for
key in ('xscale', 'xlim', 'epoch', 'yscale', 'ylabel'))
(key, params.pop(key))
for key in (
'xscale',
'xlim',
'epoch',
'yscale',
'ylabel',
'sortbycolor',
)
)

# create plot
if args.tiles:
Expand Down
2 changes: 1 addition & 1 deletion gwsumm/plot/triggers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def draw(self):
plotargs.append(dict())
# get plot arguments
for key in ['vmin', 'vmax', 'edgecolor', 'facecolor', 'cmap', 's',
'marker', 'rasterized']:
'marker', 'rasterized', 'sortbycolor']:
try:
val = self.pargs.pop(key)
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install_requires =
astropy >=3.0.0
gwdatafind >=1.1.1
gwdetchar >=2.0.0
gwpy >=2.0.0
gwpy >=3.0.0
gwtrigfind
lalsuite
ligo-segments
Expand Down

0 comments on commit 3bfdb2b

Please sign in to comment.