We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df7313d commit 01b4a73Copy full SHA for 01b4a73
stagpy/config.py
@@ -32,6 +32,11 @@ def _index_collection(arg):
32
return [_actual_index(item) for item in arg.split(',') if item]
33
34
35
+def _float_list(arg):
36
+ """Build a tuple of floats from a command line input."""
37
+ return tuple(float(val) for val in arg.split(',') if val)
38
+
39
40
HOME_DIR = pathlib.Path.home()
41
CONFIG_DIR = HOME_DIR / '.config' / 'stagpy'
42
CONFIG_FILE = CONFIG_DIR / 'config.toml'
@@ -72,6 +77,8 @@ def _index_collection(arg):
72
77
('vmax', Conf(None, True, None, {'type': float},
73
78
False, 'maximal value on plot')),
74
79
('cminmax', switch_opt(False, 'C', 'constant min max across plots')),
80
+ ('isolines', Conf(None, True, None, {'type': _float_list},
81
+ False, 'arbitrary isoline value, comma separated')),
75
82
('mplstyle', Conf('stagpy-paper', True, None,
76
83
{'nargs': '?', 'const': '', 'type': str},
84
True, 'matplotlib style')),
stagpy/field.py
@@ -257,6 +257,8 @@ def plot_iso(axis, step, var, **extra):
257
extra_opts['colors'] = conf.field.isocolors.split(',')
258
elif 'colors' not in extra:
259
extra_opts['cmap'] = conf.field.cmap.get(var)
260
+ if conf.plot.isolines:
261
+ extra_opts['levels'] = sorted(conf.plot.isolines)
262
extra_opts.update(extra)
263
axis.contour(xmesh, ymesh, fld, **extra_opts)
264
0 commit comments