Skip to content

Commit

Permalink
Add default rcParams (#386)
Browse files Browse the repository at this point in the history
* add default rcParams

* fix rcParams test

* fix figsize assertion

---------

Co-authored-by: Iara Ota <iara.ota@ligo.org>
  • Loading branch information
iaraota and Iara Ota authored Feb 5, 2024
1 parent a18f5e8 commit 3d59f66
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
36 changes: 35 additions & 1 deletion gwsumm/plot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,41 @@ class DataPlot(SummaryPlot):
#: plot() call style
_single_call = False
#: dict of default plotting kwargs
defaults = {}
defaults = {
'animation.convert_args': ['-layers', 'OptimizePlus'],
'axes.axisbelow': False,
'axes.edgecolor': 'gray',
'axes.formatter.limits': [-3, 4],
'axes.formatter.use_mathtext': True,
'axes.grid': True,
'axes.labelpad': 5.0,
'axes.labelsize': 18.0,
'axes.titlesize': 22.0,
'contour.algorithm': 'mpl2014',
'figure.figsize': [12.0, 6.0],
'figure.labelsize': 'large',
'figure.labelweight': 'normal',
'font.sans-serif': ['Roboto'],
'grid.alpha': 0.5,
'grid.linewidth': 0.5,
'legend.edgecolor': 'inherit',
'legend.fancybox': False,
'legend.fontsize': 10.0,
'legend.handlelength': 1.0,
'legend.numpoints': 2,
'mathtext.bf': 'Roboto',
'mathtext.cal': 'Calligraffiti',
'mathtext.fontset': 'custom',
'mathtext.it': 'Roboto:italic',
'mathtext.rm': 'Roboto',
'mathtext.sf': 'Roboto',
'mathtext.tt': 'Roboto Slab',
'savefig.transparent': True,
'svg.fonttype': 'none',
'text.parse_math': True,
'xtick.labelsize': 14.0,
'ytick.labelsize': 14.0,
}
#: list of parameters parsed for `plot()` calls
DRAW_PARAMS = list(putils.ARTIST_PARAMS)

Expand Down
2 changes: 1 addition & 1 deletion gwsumm/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_from_ini(self):
assert plot.channels == [get_channel('X1:TEST'),
get_channel('Y1:TEST')]
assert plot.pargs == {'marker': 'o'}
assert plot.rcParams == {'figure.figsize': (2, 1)}
assert plot.rcParams['figure.figsize'] == (2, 1)

cp.set('plot', 'type', 'blah')
with pytest.warns(UserWarning):
Expand Down

0 comments on commit 3d59f66

Please sign in to comment.